public function getToolbar($toolbar, $config = array())
    {
        $identifier = $toolbar;
        if (! ($toolbar instanceof AnServiceIdentifier)) {
            //Create the complete identifier if a partial identifier was passed
           if (is_string($toolbar) && strpos($toolbar, '.') === false) {
               $identifier = clone $this->getIdentifier();
               $identifier->path = array('controller', 'toolbar');
               $identifier->name = $toolbar;
           } else {
               $identifier = $this->getIdentifier($toolbar);
           }
        }

        if (! isset($this->_toolbars[$identifier->name])) {
            $config['controller'] = $this->getMixer();
            $toolbar = $this->getService($identifier, $config);

           //Check the toolbar interface
           if (! ($toolbar instanceof AnControllerToolbarInterface)) {
               throw new AnControllerToolbarException("Controller toolbar $identifier does not implement AnControllerToolbarInterface");
           }
        } else {
            $toolbar = $this->_toolbars[$identifier->name];
        }

        return $toolbar;
    }
public function getToolbar($toolbar, $config = array())
    {
        $identifier = $toolbar;
        if (! ($toolbar instanceof AnServiceIdentifier)) {
            //Create the complete identifier if a partial identifier was passed
           if (is_string($toolbar) && strpos($toolbar, '.') === false) {
               $identifier = clone $this->getIdentifier();
               $identifier->path = array('controller', 'toolbar');
               $identifier->name = $toolbar;
           } else {
               $identifier = $this->getIdentifier($toolbar);
           }
        }

        if (! isset($this->_toolbars[$identifier->name])) {
            $config['controller'] = $this->getMixer();
            $toolbar = $this->getService($identifier, $config);

           //Check the toolbar interface
           if (! ($toolbar instanceof AnControllerToolbarInterface)) {
               throw new AnControllerToolbarException("Controller toolbar $identifier does not implement AnControllerToolbarInterface");
           }
        } else {
            $toolbar = $this->_toolbars[$identifier->name];
        }

        return $toolbar;
    }
public function getToolbar ( $ toolbar , $ config = array ( ) ) { $ identifier = $ toolbar ; if ( ! ( $ toolbar instanceof AnServiceIdentifier ) ) { //Create the complete identifier if a partial identifier was passed if ( is_string ( $ toolbar ) && strpos ( $ toolbar , '.' ) === false ) { $ identifier = clone $ this -> getIdentifier ( ) ; $ identifier -> path = array ( 'controller' , 'toolbar' ) ; $ identifier -> name = $ toolbar ; } else { $ identifier = $ this -> getIdentifier ( $ toolbar ) ; } } if ( ! isset ( $ this -> _toolbars [ $ identifier -> name ] ) ) { $ config [ 'controller' ] = $ this -> getMixer ( ) ; $ toolbar = $ this -> getService ( $ identifier , $ config ) ; //Check the toolbar interface if ( ! ( $ toolbar instanceof AnControllerToolbarInterface ) ) { throw new AnControllerToolbarException ( "Controller toolbar $identifier does not implement AnControllerToolbarInterface" ) ; } } else { $ toolbar = $ this -> _toolbars [ $ identifier -> name ] ; } return $ toolbar ; }
Get a toolbar by identifier

@return AnControllerToolbarAbstract
Get a toolbar by identifier