Skip to content

Instantly share code, notes, and snippets.

@DiyarD
DiyarD / Router.php
Last active July 29, 2016 10:57
A Very Simple PHP Router
<?php
class Router
{
protected $_routes;
protected $routeMethods = ['get', 'post'];
public function add($pattern, $callback, $options) {
$pattern = '/' . trim($pattern, '/');