$url_prefix
$url_prefix :
Dispatch to Controllers based on rules.
Most rules match specific URL patterns, and so one script can dispatch to many different controllers and methods, depending on the current URL.
NOTE: This is being deprecated in favour of the Routing Dispatcher. When all apps have moved to the new dispatches, this library will be removed entirely, as it's a horrid mess.
addNestedController(Mixed $paths, String $name, Int $offset = False)
Add a controller to a nested path specification.
Due to the way Dispatch matches rules, you must make sure deeper nested path specs are added first, so they match before their parent paths.
| Mixed | $paths | The path to match. See below. |
| String | $name | The controller name. |
| Int | $offset | If set to an integer, defines path offset. The $paths can be specified in two formats. One is a simple path string, with / characters separating the path segments. The other is to specify an array of path components. If using the array method, you must ensure the path components are valid and contain no / characters. |
addDynamicController(Bool $splice = true)
Add CodeIgniter-style controller dispatching.
Adds a controller rule that will determine the controller name and method name based on the URL path. If you use this, it should be added after any explicit URL matching rules.
| Bool | $splice | Remove the first two path entries? [True] |
addDefaultController(String $name)
Add a default controller that will be used if no other rules match.
This should be done only after ALL other rules have been added, as this rule will always match, and therefore no rule after it will ever be matched.
| String | $name | Name of the controller to dispatch to. |
addRootController(String $name)
Add a controller which will be used at the "root" URL.
This matches the "base" or "root" URL only. There can be only one "root" controller, and the first one found will be dispatched to.
| String | $name | Name of the controller to dispatch to. |
addLookupController(String $name, String $method)
Add a controller that see's if it can handle the path via a method.
The lookup method can return a few different values:
| String | $name | The name of the controller. |
| String | $method | The name of the lookup method. |