2008年9月9日星期二

[fw-mvc] Array URL Parameters

OK, I think this is probably a dumb question. Is there a syntax for having one URL parameter with multiple values pulled in as an array? For example, without using MVC I could just do:

http://www.example.com/?controller=foo&action=bar&param[]=x&param[]=y

And access param as:

$param = $_GET['param'];
echo $param[0]; //echos x
echo $param[1]; //echos y

Do I simply do the following?

http://www.example.com/foo/bar/param[]/x/param[]/y/

I think I may have answered my own question - now I'll try it and find out ;-)

Are there any other ways to do this that people have tried?

--
Bradley Holt
bradley.holt@foundline.com

没有评论: