public function getToolbarCommands($name)
    {
        $result = array();

        if ($this->_state->toolbar instanceof AnControllerToolbarAbstract) {
            $this->_state->toolbar->reset();
            $method = 'add'.ucfirst($name).'Commands';

            if (method_exists($this->_state->toolbar, $method)) {
                $this->_state->toolbar->$method();
            }

            $commands = $this->_state->toolbar->getCommands();

            foreach ($commands as $command) {
                $result[] = $command->getname();
            }
        }

        return $result;
    }
public function getToolbarCommands($name)
    {
        $result = array();

        if ($this->_state->toolbar instanceof AnControllerToolbarAbstract) {
            $this->_state->toolbar->reset();
            $method = 'add'.ucfirst($name).'Commands';

            if (method_exists($this->_state->toolbar, $method)) {
                $this->_state->toolbar->$method();
            }

            $commands = $this->_state->toolbar->getCommands();

            foreach ($commands as $command) {
                $result[] = $command->getname();
            }
        }

        return $result;
    }
public function getToolbarCommands ( $ name ) { $ result = array ( ) ; if ( $ this -> _state -> toolbar instanceof AnControllerToolbarAbstract ) { $ this -> _state -> toolbar -> reset ( ) ; $ method = 'add' . ucfirst ( $ name ) . 'Commands' ; if ( method_exists ( $ this -> _state -> toolbar , $ method ) ) { $ this -> _state -> toolbar -> $ method ( ) ; } $ commands = $ this -> _state -> toolbar -> getCommands ( ) ; foreach ( $ commands as $ command ) { $ result [ ] = $ command -> getname ( ) ; } } return $ result ; }
Gets the toolbar commands. This method checks if the view state has
a toolbar.

@param string $name The name of the commands

@return array Return an array of commands
Gets the toolbar commands . This method checks if the view state has a toolbar .