classes/Routing/UrlGenerator.php
public function action($controller = null, $id = null)
    {
        // Assume that the current, first path segment is the directory decoy is
        // running in
        preg_match('#[a-z-]+#i', $this->path, $matches);
        $decoy = $matches[0];

        // Strip the action from the controller
        $action = '';
        if (preg_match('#@\w+$#', $controller, $matches)) {
            $action = substr($matches[0], 1);
            $controller = substr($controller, 0, -strlen($matches[0]));
        }

        // Convert controller for URL
        $controller = $this->slugController($controller);

        // Begin the url
        $path = '/'.$decoy.'/'.$controller;

        // If there is an id, add it now
        if ($id) {
            $path .= '/'.$id;
        }

        // Now, add actions (except for index, which is implied by the lack of an action)
        if ($action && $action != 'index') {
            $path .= '/'.$action;
        }

        // Done, return it
        return $path;
    }
public function action($controller = null, $id = null)
    {
        // Assume that the current, first path segment is the directory decoy is
        // running in
        preg_match('#[a-z-]+#i', $this->path, $matches);
        $decoy = $matches[0];

        // Strip the action from the controller
        $action = '';
        if (preg_match('#@\w+$#', $controller, $matches)) {
            $action = substr($matches[0], 1);
            $controller = substr($controller, 0, -strlen($matches[0]));
        }

        // Convert controller for URL
        $controller = $this->slugController($controller);

        // Begin the url
        $path = '/'.$decoy.'/'.$controller;

        // If there is an id, add it now
        if ($id) {
            $path .= '/'.$id;
        }

        // Now, add actions (except for index, which is implied by the lack of an action)
        if ($action && $action != 'index') {
            $path .= '/'.$action;
        }

        // Done, return it
        return $path;
    }
public function action ( $ controller = null , $ id = null ) { // Assume that the current, first path segment is the directory decoy is // running in preg_match ( '#[a-z-]+#i' , $ this -> path , $ matches ) ; $ decoy = $ matches [ 0 ] ; // Strip the action from the controller $ action = '' ; if ( preg_match ( '#@\w+$#' , $ controller , $ matches ) ) { $ action = substr ( $ matches [ 0 ] , 1 ) ; $ controller = substr ( $ controller , 0 , - strlen ( $ matches [ 0 ] ) ) ; } // Convert controller for URL $ controller = $ this -> slugController ( $ controller ) ; // Begin the url $ path = '/' . $ decoy . '/' . $ controller ; // If there is an id, add it now if ( $ id ) { $ path .= '/' . $ id ; } // Now, add actions (except for index, which is implied by the lack of an action) if ( $ action && $ action != 'index' ) { $ path .= '/' . $ action ; } // Done, return it return $ path ; }
Make a URL given a fully namespaced controller.  This only generates routes
as if the controller is in the root level; as if it has no parents.

@param  string  $controller ex: Bkwld\Decoy\Controllers\Admins@create
@param  integer $id
@return string  ex: http://admin/admins/create
Make a URL given a fully namespaced controller . This only generates routes as if the controller is in the root level ; as if it has no parents .