-
Notifications
You must be signed in to change notification settings - Fork 2
Custom Routing
Pedro Santana edited this page Oct 27, 2015
·
1 revision
With FlavorPHP you can add custom routing to your applictaions.
To handle a custom uri you need to add a router target in the router.php
file, to catch the params of the uri you have to create a regex group by each param.
<?php
$this->add(string $route, mixed $target);
?>
When $route
is a regex string and $target
could be string or array with 'controller', 'action' and 'params' keys.
<?php
$this->add("about", "index/about");
$this->add("tos", "index/tos");
$this->add("privacy", "index/privacy");
$this->add("signin", "index/signin");
$this->add("store/setup/name", "store/setup_name");
$this->add("store/setup/listings", "store/setup_listings");
$this->add("store/setup/payments", "store/setup_payments");
$this->add("store/setup/open", "store/setup_open");
?>