Methods summary
protected
|
#
rewriteRouting( string|null $requestCtrlName, string|null $requestActionName )
Try to parse first word from request path to get proper routes group.
If there is no first word in request path, get default routes group.
Try to parse first word from request path to get proper routes group.
If there is no first word in request path, get default routes group.
If there is any configured pre-routing handler, execute the handler to
for example load only specific routes from database or anything else.
Go through all chosen routes and check if route is possible to use for
current request. Then try to match route by given request. If route doesn't
match the request, continue to another route and try to complete current
route object. If route matches the request, set up default and request
params and try to process route filtering in. If it is successful, set
up current route object and end route matching process.
Parameters
- $requestCtrlName
Possible controller name value or NULL assigned directly
from request object in \MvcCore\router::routeDetectStrategy();
- $requestActionName
Possible action name value or NULL assigned directly
from request object in \MvcCore\router::routeDetectStrategy();
Throws
LogicException Route configuration property is missing.
InvalidArgumentException Wrong route pattern format.
|
protected
string
|
#
rewriteRoutingGetReqPathFirstWord( )
Parse first word from request path - first element between first two slashes.
Return for example from /eshop/detail/name first word eshop .
If there is no first word in request path, return an empty string.
Parse first word from request path - first element between first two slashes.
Return for example from /eshop/detail/name first word eshop .
If there is no first word in request path, return an empty string.
Returns
string
|
protected
|
#
rewriteRoutingProcessPreHandler( string $firstPathWord )
Call any configured pre-route matching handler with first parsed word from
requested path and with request object to load for example from database
only routes you need to use for routing, not all of them.
Call any configured pre-route matching handler with first parsed word from
requested path and with request object to load for example from database
only routes you need to use for routing, not all of them.
Parameters
|
protected
array|MvcCore\Route[]
|
#
rewriteRoutingGetRoutesToMatch( string $firstPathWord )
Get specific routes group by first parsed word from request path if any.
If first path word is an empty string, there is returned routes with no group
word defined. If still there are no such routes in default group, returned
is an empty array.
Get specific routes group by first parsed word from request path if any.
If first path word is an empty string, there is returned routes with no group
word defined. If still there are no such routes in default group, returned
is an empty array.
Parameters
Returns
|
protected
boolean
|
#
rewriteRoutingCheckRoute( MvcCore\IRoute $route, array $additionalInfo )
Return TRUE if there is possible by additional info array records
to route request by given route as first argument. For example if route
object has defined http method and request has the same method or not
or much more by additional info array records in extended classes.
Return TRUE if there is possible by additional info array records
to route request by given route as first argument. For example if route
object has defined http method and request has the same method or not
or much more by additional info array records in extended classes.
Parameters
Returns
boolean
|
protected
|
#
rewriteRoutingSetRequestedAndDefaultParams( array & $allMatchedParams, string|null $requestCtrlName = NULL, string|null $requestActionName = NULL )
When route is matched, set up request and default params.
When route is matched, set up request and default params.
Request params are necessary to complete any self URL, to route request
properly, to complete canonical URL and to process possible route redirection.
Default params are necessary to handle route filtering in and out and to
complete URL by any other route name for case, when some required param
is not presented in second $params argument in Url() method (then the
param is assigned from default params).
This method also completes any missing controller or action param
values with default values. Request params can not contain those
automatically completed values, only values really requested.
Parameters
- $allMatchedParams
All matched params completed \MvcCore\Route::Matches(); ,
where could be controller and action if it is defined in
route object, default param values from route and all
rewrite params parsed by route.
- $requestCtrlName
Possible controller name value or NULL assigned directly
from request object in \MvcCore\router::routeDetectStrategy();
- $requestActionName
Possible action name value or NULL assigned directly from
request object in \MvcCore\router::routeDetectStrategy();
|
protected
boolean
|
#
rewriteRoutingSetRequestParams( array & $allMatchedParams )
Filter route in and if filtering is not successful, return TRUE about
continuing another route matching. If filtering is successful, set matched
controller and action into request object and return TRUE to finish routes
matching process.
Filter route in and if filtering is not successful, return TRUE about
continuing another route matching. If filtering is successful, set matched
controller and action into request object and return TRUE to finish routes
matching process.
Parameters
- $allMatchedParams
All matched params completed \MvcCore\Route::Matches(); ,
where could be controller and action if it is defined in
route object, default param values from route and all
rewrite params parsed by route.
Returns
boolean
|
protected
|
#
rewriteRoutingSetUpCurrentRouteByRequest( )
Set up into current route controller and action
in pascal case from request object.
Set up into current route controller and action
in pascal case from request object.
|