'news/:category/:furl' => 'news/entry', ':category/:furl' => 'content/page',
'admin/login(.*)?' => 'admin/login/$1' does indeed work. However, 'admin/:controller(/.*)?' => 'admin/$1$2' does not. I really need the latter.Harro Verton wrote on Friday 1st of July 2011:Ok, I understand. I've just expanded my routes to
'admin/index(.*)?' => 'welcome/admin/$1', ':this/:that' => 'welcome/index',and still welcome/admin is called, the second route doesn't have any influence. You will have to add the admin route manually, as this last rule will capture any URI, and autorouting no longer works.
'admin/:controller(/.*)?' => 'welcome/admin/$1',works without problems here. With URI 'admin/something/test/one/two' I get
// from $this->params(): array 'controller' => string 'something' (length=9) // from Uri::segments() array 0 => string 'admin' (length=5) 1 => string 'something' (length=9) 2 => string 'test' (length=4) 3 => string 'one' (length=3) 4 => string 'two' (length=3)
Harro Verton wrote on Wednesday 6th of July 2011:'admin/:controller(/.*)?' => 'welcome/admin/$1',works without problems here. With URI 'admin/something/test/one/two' I get// from $this->params(): array 'controller' => string 'something' (length=9) // from Uri::segments() array 0 => string 'admin' (length=5) 1 => string 'something' (length=9) 2 => string 'test' (length=4) 3 => string 'one' (length=3) 4 => string 'two' (length=3)
What is it exactly that doesn't work?
Harro Verton wrote on Thursday 7th of July 2011:With what routes? with the above route, welcome/admin/create will be called, with :controller = news. Fuel only checks for a controller/method match is the request isn't captured by a route. So if you have any route that captures admin/news/create, the fact that you have a news controller with an action_create() method is no longer relevant.
Harro Verton wrote on Thursday 7th of July 2011:I honestly can't say. The way routing works is that the URI is matched against each of the routes, in the sequence in which they are defined. If there is no match at the end, autodetection is performed. If that fails to, you'll get a 404. It is up to you, and your specific situation, to define the routes that do what you want.
'admin/login(/.*)?' => 'admin/login/$1', 'admin/:controller' => 'admin/$1',
Calvin Froedge wrote on Thursday 30th of June 2011:It doesn't work for all use cases or this one in particular? Did you place this rule above or below that other wildcard?
Harro Verton wrote on Thursday 30th of June 2011:Just added an action_admin() method to the welcome controller of a fresh Fuel install. Added this route: 'admin/index(.*)?' => 'welcome/admin/$1', And finished with '(:any)' => 'welcome/404' to disable any fall-though or autodetect behaviour. A URI like admin/index/test/one/two loads the new admin method without problems, and URI::segments() gives me all segments in the URI. So I can't reproduce your issue here.
'admin/index(.*)?' => 'welcome/admin/$1', ':this/:that' => 'welcome/index',and still welcome/admin is called, the second route doesn't have any influence. You will have to add the admin route manually, as this last rule will capture any URI, and autorouting no longer works.
It looks like you're new here. If you want to get involved, click one of these buttons!