5121 Posts in 1527 Topics by 1119 members
|
Page:
1
|
Go to End | |
| Author | Topic: | 2131 Views |
-
Director addRules and extra params

12 May 2010 at 7:00am
How should I construct Director:addRules(); like :
Director::addRules(10, array(
'/$Action/$ID/$OtherID/$Region/$Country/$City' => 'SearchPage_Controller',
));So I can use (also with nested urls enabled):
http://www.domain.com/home/{$someURLSegment}/{$someAction}/id/otherid/region/country/city/
When I add the above rules I get the error:
[User Warning] popCurrent called on ModelAsController controller, but it wasn't at the top of the stack
-
Re: Director addRules and extra params

17 August 2011 at 5:03pm
I realize this is an old post, but were you able to figure this out?
I have a similar set up, where I want to have domain.com/myPage/show/ID/otherID/itemID
it could go one or two more deeper, but I'm just trying to get the $ItemID part figured out.I get the same error as you did, and I've tried:
Director::addRules(100, array(
'$Controller//$Action/$ID/$OtherID/$ItemID' => '*'
));
andDirector::addRules(100, array(
'/$Action/$ID/$OtherID/$ItemID' => 'MyPage_Controller'
)); -
Re: Director addRules and extra params

25 October 2011 at 10:40am Last edited: 25 October 2011 10:42am
Do any of the ideas at http://www.silverstripe.org/general-questions/show/16057 answer your question?
| 2131 Views | ||
|
Page:
1
|
Go to Top |



