Hi Guys, I need your help ;(
I want to script a little shop and I want to use urls like this: http://localhost/shop/Woman/Dessous and optional parameters like: pc = Which page is active, ac = How much articels are on one page
So, I configured my route rule like this:
‘urlManager’=>array(
'showScriptName' => false,
'urlFormat' => 'path',
'rules'=>array(
'shop/show/<first_name:\d+>/<second_name:\d+>/*' => 'shop/show',
),
First and little problem is, my URL look like this:
http://localhost/shop/show/Woman/Dessous
and not like
http://localhost/shop/Woman/Dessous
if I remove the /show from the rule than I get an exception that the action Woman can not be found.
OK, but like I said this is the small problem!
The bigger problem is, my GET Array look like this:
array(1) {
["Woman"]=>
string(7) "Dessous"
}
…how should I work with this???
In my Controller I need an array with the named index "first_name", "last_name" and so on.
The perfect example is the .NET MVC Framework, in this you can declare your Action like (Converted into PHP)
public function actionShow($first_name, $second_name)
And the framework looks if it found parameters in the request with the name in the action decleration!
But, anyway, I need only a way to access my Route Values, can someone help me?
Best regards