1. Go to this page and download the library: Download geniv/nette-alias-router library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
geniv / nette-alias-router example snippets
public static function createRouter(ILocale $locale, IAliasRouter $aliasRouter): IRouter
...
if ($aliasRouter->isEnabled()) {
$aliasRouter->setDefaultParameters('Homepage', 'default', 'cs');
$aliasRouter->setPaginatorVariable('visualPaginator-page');
//$aliasRouter->setSecure(true);
//$aliasRouter->setOneWay(true);
$router[] = $aliasRouter->getRouter();
}
use AliasRouter\Drivers\IDriver;
$this->context->getByType(IDriver::class)->deleteRouter('Homepage', 'default');
$this->context->getByType(IDriver::class)->createRouter('Homepage', 'default', 'muj alias');
$this->context->getByType(IDriver::class)->createRouter('Homepage', 'default', 'muj alias XX', ['locale' => 'en']);
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.