8000 GitHub - fuelphp-storage/routing: FuelPHP Framework - Request Routing library
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fuelphp-storage/routing

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fuel Routing

Build Status Code Coverage Quality Score

FuelPHP Framework routing.

Sample code

<?php

include "./vendor/autoload.php";

use Fuel\Routing\Router;

$router = new Router;
$router->setType('string', Router::MATCH_ANY);
$router->setType('num', Router::MATCH_NUM);
$router->setType('int', Router::MATCH_NUM);

$router->all('/')->filters([
		'controller' => 'SomeController',
		'action' => 'someAction',
	]);

$router->post('users')->filters([
		'controller' => 'UserController',
		'action' => 'create',
	]);

$router->get('users')->filters([
		'controller' => 'UserController',
		'action' => 'index',
	]);

$router->put('users/{int:id}')->filters([
		'controller' => 'UserController',
		'action' => 'update',
	]);

var_dump($router->translate('users/123', 'PUT'));

Besides defining the filter per route definition manually, you can also define an autofilter, which is something callable that will convert the translated route into a controller and action.

Contributing

Thank you for considering contribution to FuelPHP framework. Please see CONTRIBUTING for details.

License

The MIT License (MIT). Please see License File for more information.

About

FuelPHP Framework - Request Routing library

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages

0