public function addRoute($route, $callable, $prepend = true)
    {
        if ($prepend) {
            $this->routes = array($route => $callable) + $this->routes;
        } else {
            $this->routes[$route] = $callable;
        }

        $this->logger->log('Route added at '.($prepend ? 'top' : 'bottom').': "'.$route.'"');
    }
public function addRoute($route, $callable, $prepend = true)
    {
        if ($prepend) {
            $this->routes = array($route => $callable) + $this->routes;
        } else {
            $this->routes[$route] = $callable;
        }

        $this->logger->log('Route added at '.($prepend ? 'top' : 'bottom').': "'.$route.'"');
    }
public function addRoute ( $ route , $ callable , $ prepend = true ) { if ( $ prepend ) { $ this -> routes = array ( $ route => $ callable ) + $ this -> routes ; } else { $ this -> routes [ $ route ] = $ callable ; } $ this -> logger -> log ( 'Route added at ' . ( $ prepend ? 'top' : 'bottom' ) . ': "' . $ route . '"' ) ; }
Add a route to the Router's routing table

The route consists of 2 parts: the route and data.

The route is a regex string which will later be matched upon Router::route().

The data can be multiple things. First it can be a string, which will later be processed and turned into
a callable. If the string is like 'controller/method' then the contoller 'Controller' will be loaded and the
method 'method' will be called. The data can also be a callable. That callable will be called with all the regex
that match the route. The callable is expected to return a string just like above. You can also provide an array.
If you have an array like this: array('callable' => array('Class', 'method')) then your callable shall be used
instead of the defaultCallabele.

@param string   $route    This is a RegEx of the route, Every capture group will be a match, passed on to a callable
@param mixed    $data     Can be multiple things. See description above
@param bool     $prepend  Whether or not to insert at the beginning of the routing table
@return void
Add a route to the Router s routing table