Trait Routing
Methods summary
public
boolean
|
#
Route( )
Route current app request by configured routes lists or by query string.
1. Check if request is targeting any internal action in internal ctrl.
2. Choose route strategy by request path and existing query string
controller and/or action values - strategy by query string or by
rewrite routes.
3. If request is not internal, redirect to possible better URL form by
configured trailing slash strategy and return FALSE for redirection.
4. Prepare media site version properties and redirect if necessary.
5. Try to complete current route object by chosen strategy.
6. If any current route found and if route contains redirection, do it.
7. If there is no current route and request is targeting homepage, create
new empty route by default values if ctrl configuration allows it.
8. If there is any current route completed, complete self route name by
it to generate self routes and canonical URL later.
9. If there is necessary, try to complete canonical URL and if canonical
URL is shorter than requested URL, redirect user to shorter version.
If there was necessary to redirect user in routing process, return
immediately FALSE and return from this method. Else continue to next
step and return TRUE . This method is always called from core routing by:
\MvcCore\Application::Run(); => \MvcCore\Application::routeRequest(); .
Route current app request by configured routes lists or by query string.
1. Check if request is targeting any internal action in internal ctrl.
2. Choose route strategy by request path and existing query string controller and/or action values - strategy by query string or by rewrite routes.
3. If request is not internal, redirect to possible better URL form by configured trailing slash strategy and return FALSE for redirection.
4. Prepare media site version properties and redirect if necessary.
5. Try to complete current route object by chosen strategy.
6. If any current route found and if route contains redirection, do it.
7. If there is no current route and request is targeting homepage, create new empty route by default values if ctrl configuration allows it.
8. If there is any current route completed, complete self route name by it to generate self routes and canonical URL later.
9. If there is necessary, try to complete canonical URL and if canonical URL is shorter than requested URL, redirect user to shorter version.
If there was necessary to redirect user in routing process, return
immediately FALSE and return from this method. Else continue to next
step and return TRUE . This method is always called from core routing by:
\MvcCore\Application::Run(); => \MvcCore\Application::routeRequest(); .
Returns
boolean
Throws
LogicException Route configuration property is missing.
InvalidArgumentException Wrong route pattern format.
|