1. Go to this page and download the library: Download dsisconeto/ciroute 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/ */
dsisconeto / ciroute example snippets
if (ENVIRONMENT == 'development') {
DIR__."/application/config/routes.php",
__DIR__."/application/cache/",
__DIR__."/application/routes/"
);
}
function ciroute($name, $arguments = [])
{
static $routes;
static $regex = "/\(:([A-Za-z0-9_.-]*)\)/";
if (!$routes) $routes = {
throw new \Exception("O segundo argumento tem que ser um array");
}
$count = 0;
$route = preg_replace_callback($regex, function () use (&$count, $arguments) {
return ($arguments[$count++]);
}, $routes[$name]);
return base_url($route);
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.