1. Go to this page and download the library: Download zaxcms/routers 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/ */
zaxcms / routers example snippets
$default = ['presenter' => 'Default', 'action' => 'default'];
$meta = (new MetadataBuilder($default))
->addAlias('bar', 'some-deep-control-param')
->build();
$router[] = new Route('/test-alias[/<bar>]', $meta);
$meta = (new MetadataBuilder($default))
->addSignalAlias('add', 'some-deep-control-add')
->build();
$router[] = new Route('/test-do[/action-<do>]', $meta);
$meta = (new MetadataBuilder($default))
->addAlias('details', 'some-deep-control-showDetails')
->addBooleanParam('details')
->build();
$router[] = new Route('/test-boolean[/<details>]', $meta);
$meta = (new MetadataBuilder($default))
->addAlias('selected', 'some-deep-control-selected')
->addArrayParam('selected', '+') // second parameter (delimiter) is optional, ',' is default
->build();
$router[] = new Route('/test-array', $meta);
$meta = (new MetadataBuilder($default))
->addAlias('item', 'list-selectedItemId')
->addAlias('view', 'list-selectedItem-<item>-view')
->build();
$router[] = new Route('/test-multiplier[/item-<item>[/view-<view>]]', $meta);
/test-array?selected=1+5+10
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.