lithium\console\command\Route::all PHP Method

all() public method

Example: sh li3 route li3 route all Will return an output similar to: Template Params -------- ------ {"controller":"pages","action":"view"} pages/{:args} {"controller":"pages","action":"view"} {:slug:[\w\-]+} {"controller":"posts","action":"show"} {:controller}/{:action}/{:args} {"action":"index"}
public all ( $scope = true ) : void
return void
    public function all($scope = true)
    {
        $routes = Router::get(null, true);
        $columns = array(array('Template', 'Params'), array('--------', '------'));
        foreach ($routes as $route) {
            $info = $route->export();
            $columns[] = array($info['template'], json_encode($info['params']));
        }
        $this->columns($columns);
    }

Usage Example

Example #1
0
 /**
  * Tests the "all" command with an env (production) param.
  *
  * Don't be confused if the expected output doesn't make sense here. We are
  * stripping the whitespace away so that this source code is easier to read.
  * Built-In methods are used for output formatting and are tested elsewhere.
  */
 public function testAllWithEnvironment()
 {
     $request = new Request();
     $request->params = array('env' => 'production');
     $command = new Route(compact('request') + array('routes' => $this->_config['routes'], 'classes' => array('response' => 'lithium\\tests\\mocks\\console\\MockResponse')));
     $command->all();
     $expected = 'TemplateParams--------------';
     $expected .= '/{"controller":"Pages","action":"view"}';
     $expected .= '/pages/{:args}{"controller":"Pages","action":"view"}';
     $this->assertEqual($this->_strip($expected), $this->_strip($command->response->output));
 }