2017 © Pedro Peláez
 

library router

PHP router

image

carlosocarvalho/router

PHP router

  • Tuesday, May 26, 2015
  • by carlosocarvalho
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 13 % Grown

The README.md

routers

Latest Stable Version Total Downloads Latest Unstable Version License, (*1)

Simple Routers PHP

Examples, (*2)

<?php use App\Router\Router;, (*3)

$router = new App\Router\Router($_SERVER["REQUEST_URI"]); $router->get('/',function(){ echo 'home page'; });, (*4)

$router->get('/posts/:id-:slug',function($id, $slug) use ($router){ echo $router->url('Blog#show',['id'=>1,'slug'=>'slugsd-idads']); },'posts.show')->with('id','[0-9]+')->with('slug','([a-z-0-9]+)');, (*5)

$router->get('/posts/:id','Blog#show');, (*6)

$router->post('/posts/:id',function($id){, (*7)

print_r($_POST); });, (*8)

$router->run();, (*9)

Use Custom Controllers

$router->get('/posts','Blog#show');, (*10)

Create new Controller BlogController.php, (*11)

The Versions

26/05 2015

dev-master

9999999-dev

PHP router

  Sources   Download

GPL

The Requires

  • php >= 5.4

 

by Carlos Carvalho

26/05 2015

1.0.0

1.0.0.0

PHP router

  Sources   Download

GPL

by Carlos Carvalho