Bluz\Router\Router
Router
- Author: Anton Shevchuk
Synopsis
- // constants
- const DEFAULT_MODULE = 'index';
- const DEFAULT_CONTROLLER = 'index';
- const ERROR_MODULE = 'error';
- const ERROR_CONTROLLER = 'index';
- // members
- protected $baseUrl;
- protected $cleanUri;
- protected string $defaultModule = self::DEFAULT_MODULE;
- protected string $defaultController = self::DEFAULT_CONTROLLER;
- protected string $errorModule = self::ERROR_MODULE;
- protected string $errorController = self::ERROR_CONTROLLER;
- protected array $params = ;
- protected array $rawParams = ;
- protected array $routers = ;
- protected array $reverse = ;
- // methods
- public void __construct()
- private array prepareRouterData()
- public string getBaseUrl()
- public void setBaseUrl()
- public mixed getParam()
- public void setParam()
- public array getParams()
- public array getRawParams()
- public string getDefaultModule()
- public void setDefaultModule()
- public string getDefaultController()
- public void setDefaultController()
- public string getErrorModule()
- public void setErrorModule()
- public string getErrorController()
- public void setErrorController()
- public string getUrl()
- public string getFullUrl()
- protected string urlCustom()
- protected string urlRoute()
- public Router process()
- protected bool processDefault()
- protected bool processCustom()
- protected bool processRoute()
- protected void resetRequest()
- public string getCleanUri()
- // Inherited methods from Options
- public mixed getOption()
- public void setOption()
- public array getOptions()
- public Options setOptions()
- protected void initOptions()
Hierarchy
Uses
Constants
Name | Value |
---|---|
DEFAULT_MODULE | 'index' |
DEFAULT_CONTROLLER | 'index' |
ERROR_MODULE | 'error' |
ERROR_CONTROLLER | 'index' |
Members
protected
- $baseUrl — string
- $cleanUri — string
- $defaultController — string
- $defaultModule — string
- $errorController — string
- $errorModule — string
- $options — array
- $params — array
- $rawParams — array
- $reverse — array
- $routers — array
Methods
private
- prepareRouterData() — Initial routers data from controllers
protected
- processCustom() — Process custom router
- processDefault() — Process default router
- processRoute() — Process router by default rules
- resetRequest() — Reset Request
- urlCustom() — Build URL by custom route
- urlRoute() — Build URL by default route
public
- __construct() — Constructor of Router
- getBaseUrl() — Get the base URL.
- getCleanUri() — Get the request URI without baseUrl
- getDefaultController() — Get default controller
- getDefaultModule() — Get default module
- getErrorController() — Get error controller
- getErrorModule() — Get error module
- getFullUrl() — Build full URL to controller
- getParam() — Get an action parameter
- getParams() — Get parameters
- getRawParams() — Get raw params, w/out module and controller
- getUrl() — Build URL to controller
- process() — Process routing
- setBaseUrl() — Set the base URL.
- setDefaultController() — Set default controller
- setDefaultModule() — Set default module
- setErrorController() — Set error controller
- setErrorModule() — Set error module
- setParam() — Set an action parameter
Inherited from Bluz\Common\Options
protected
- initOptions() — Check and initialize options in package
public
- getOption() — Get option by key
- getOptions() — Get all options
- setOption() — Set option by key over setter
- setOptions() — Setup, check and init options
History
-
2017-08-22T10:52:12+00:00 (commit #050cb2f)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed Router tests
-
2017-08-22T10:24:41+00:00 (commit #5e16d33)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed full Url method in `Router`
-
2017-06-30T08:36:40+00:00 (commit #2259ecf)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed comments style
-
2017-04-27T10:40:32+00:00 (commit #bf83733)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Fixed codestyle in Router
-
2017-04-27T09:56:41+00:00 (commit #2e5b01a)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added tests for Controller Mapper
-
2017-04-26T12:53:22+00:00 (commit #ff59da1)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `Common\Line` class Added `to_camel_case` function Added `str_trim_end` function
-
2017-04-21T15:14:44+00:00 (commit #c7538da)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Replace `sizeof` to `count`
-
2017-04-21T15:13:17+00:00 (commit #5e9b7bc)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small codestyle fixes
-
2017-04-21T13:24:35+00:00 (commit #3b25a3d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Small update for codestyle
-
2017-04-13T11:17:00+00:00 (commit #106162d)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Refactoring: - renamed Controller\Reflection to Controller\Meta (for avoid mistake with Reflection class) - set absolute path for file loader - very small perfomance optiomization - small fixes with codestyle
-
2017-02-15T16:09:44+00:00 (commit #0fc0c8b)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Updated coveralls config
-
2017-02-13T10:14:18+00:00 (commit #43dbf55)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Rollback to `getCount()` method
-
2017-01-30T13:15:49+00:00 (commit #fd5d943)
Author: Anton (AntonShevchuk@gmail.com) / Commiter: GitHub (AntonShevchuk@gmail.com)
Merge pull request #395 from AntonShevchuk/master Added `AttachmentResponse`
-
2017-01-30T12:38:53+00:00 (commit #0ab8691)
Author: Anton Shevchuk (AntonShevchuk@gmail.com) / Commiter: Anton Shevchuk (AntonShevchuk@gmail.com)
Added `AttachmentResponse` Added `attachment($file)` helper for `Controller`