PHP Classes


Recommend this page to a friend!
  Classes of carlos carvalho   Simple PHP Routers   Download  
Role: Documentation
Content type: text/markdown
Description: Documentation
Class: Simple PHP Routers
Route HTTP requests to given callback functions
Author: By
Last change:
Date: 5 years ago
Size: 1,180 bytes


Class file image Download


Latest Stable Version Total Downloads Latest Unstable Version License

Simple Routers PHP


<?php use App\Router\Router;

$router = new App\Router\Router($_SERVER["REQUEST_URI"]); $router->get('/',function(){

echo 'home page';


$router->get('/posts/:id-:slug',function($id, $slug) use ($router){

echo $router->url('Blog#show',['id'=>1,'slug'=>'slugsd-idads']);




print_r($_POST); });


Use Custom Controllers


Create new Controller BlogController.php