public function beforeExecuteRoute()
    {
        //sets active task and action names
        $this->actionName = $this->dispatcher->getActionName();
        $this->taskName = $this->dispatcher->getTaskName();

        $this->setupOptions();

        //if -h or --help option was typed in command line then show only help
        $this->args = $this->dispatcher->getParam('args');
        if ($this->containHelpOption($this->args)) {
            $this->renderActionHelp();
            //stop dispatching
            return false;
        }
        try {
            $this->validate($this->args);
        } catch (InvalidArgumentException $ex) {
            $this->throwError(strtr(':command: Invalid argument `:argument` for option `:option`', [
                ':command' => sprintf('%s %s', $this->dispatcher->getParam('activeTask'), $this->dispatcher->getParam('activeAction')),
                ':option' => $ex->getOption(),
                ':argument' => $ex->getArgument()
            ]));
        } catch (InvalidOptionException $ex) {
            $this->throwError(strtr(':command: Invalid option `:option`', [
                ':command' => sprintf('%s %s', $this->dispatcher->getParam('activeTask'), $this->dispatcher->getParam('activeAction')),
                ':option' => $ex->getOption()
            ]));
        }

        return true;
    }
public function beforeExecuteRoute()
    {
        //sets active task and action names
        $this->actionName = $this->dispatcher->getActionName();
        $this->taskName = $this->dispatcher->getTaskName();

        $this->setupOptions();

        //if -h or --help option was typed in command line then show only help
        $this->args = $this->dispatcher->getParam('args');
        if ($this->containHelpOption($this->args)) {
            $this->renderActionHelp();
            //stop dispatching
            return false;
        }
        try {
            $this->validate($this->args);
        } catch (InvalidArgumentException $ex) {
            $this->throwError(strtr(':command: Invalid argument `:argument` for option `:option`', [
                ':command' => sprintf('%s %s', $this->dispatcher->getParam('activeTask'), $this->dispatcher->getParam('activeAction')),
                ':option' => $ex->getOption(),
                ':argument' => $ex->getArgument()
            ]));
        } catch (InvalidOptionException $ex) {
            $this->throwError(strtr(':command: Invalid option `:option`', [
                ':command' => sprintf('%s %s', $this->dispatcher->getParam('activeTask'), $this->dispatcher->getParam('activeAction')),
                ':option' => $ex->getOption()
            ]));
        }

        return true;
    }
public function beforeExecuteRoute ( ) { //sets active task and action names $ this -> actionName = $ this -> dispatcher -> getActionName ( ) ; $ this -> taskName = $ this -> dispatcher -> getTaskName ( ) ; $ this -> setupOptions ( ) ; //if -h or --help option was typed in command line then show only help $ this -> args = $ this -> dispatcher -> getParam ( 'args' ) ; if ( $ this -> containHelpOption ( $ this -> args ) ) { $ this -> renderActionHelp ( ) ; //stop dispatching return false ; } try { $ this -> validate ( $ this -> args ) ; } catch ( InvalidArgumentException $ ex ) { $ this -> throwError ( strtr ( ':command: Invalid argument `:argument` for option `:option`' , [ ':command' => sprintf ( '%s %s' , $ this -> dispatcher -> getParam ( 'activeTask' ) , $ this -> dispatcher -> getParam ( 'activeAction' ) ) , ':option' => $ ex -> getOption ( ) , ':argument' => $ ex -> getArgument ( ) ] ) ) ; } catch ( InvalidOptionException $ ex ) { $ this -> throwError ( strtr ( ':command: Invalid option `:option`' , [ ':command' => sprintf ( '%s %s' , $ this -> dispatcher -> getParam ( 'activeTask' ) , $ this -> dispatcher -> getParam ( 'activeAction' ) ) , ':option' => $ ex -> getOption ( ) ] ) ) ; } return true ; }
Sets available actions with options
Validates command line arguments and options for command
Stops dispatching when detects help option

@see http://docs.phalconphp.com/pl/latest/reference/dispatching.html
@return bool
Sets available actions with options Validates command line arguments and options for command Stops dispatching when detects help option