FOF30\Factory\BasicFactory::toolbar PHP Method

toolbar() public method

Creates a new Toolbar
public toolbar ( array $config = [] ) : Toolbar
$config array The configuration values for the Toolbar object
return FOF30\Toolbar\Toolbar
    public function toolbar(array $config = array())
    {
        $toolbarClass = $this->container->getNamespacePrefix($this->getSection()) . 'Toolbar\\Toolbar';
        try {
            return $this->createToolbar($toolbarClass, $config);
        } catch (ToolbarNotFound $e) {
            // Not found. Return the default Toolbar
            return new Toolbar($this->container, $config);
        }
    }

Usage Example

Esempio n. 1
0
 /**
  * Creates a new Toolbar
  *
  * @param   array  $config  The configuration values for the Toolbar object
  *
  * @return  Toolbar
  */
 public function toolbar(array $config = array())
 {
     $appConfig = $this->container->appConfig;
     $defaultConfig = array('useConfigurationFile' => true, 'renderFrontendButtons' => in_array($appConfig->get("views.*.config.renderFrontendButtons"), array(true, 'true', 'yes', 'on', 1)), 'renderFrontendSubmenu' => in_array($appConfig->get("views.*.config.renderFrontendSubmenu"), array(true, 'true', 'yes', 'on', 1)));
     $config = array_merge($defaultConfig, $config);
     return parent::toolbar($config);
 }