geniv/nette-static-router

This package is abandoned and no longer maintained. No replacement package was suggested.

Static alias router extension for Nette Framework

v1.0.4 2018-02-15 23:17 UTC

This package is auto-updated.

Last update: 2020-02-13 18:22:21 UTC


README

Installation

$ composer require geniv/nette-static-router

or

"geniv/nette-static-router": ">=1.0.0"

require:

"php": ">=5.6.0",
"nette/nette": ">=2.4.0",
"geniv/nette-locale": ">=1.0.0"

Include in application

neon configure:

# static router
staticRouter:
#   autowired: self
#   domainSwitch: false
#   domainAlias:
#        example.cz: cs
#        example.com: en
#        example.de: de
    route:
        cs:
            "staticky-slug": "Homepage:pokus"
            "staticky-slug1": "Homepage:pokus2"
        en:
            "static-slu": "Homepage:pokus"
            "static-slug1": "Homepage:pokus2"

neon configure extension:

extensions:
    staticRouter: StaticRouter\Bridges\Nette\Extension

RouterFactory.php:

public static function createRouter(ILocale $locale, StaticRouter $staticRouter): IRouter
...
$router[] = $staticRouter;
$staticRouter->setDefaultParameters('Homepage', 'default', 'cs');
$staticRouter->setPaginatorVariable('visualPaginator-page');
//$staticRouter->setSecure(true);
//$staticRouter->setOneWay(true);