Pimcore\View\Helper\PimcoreNavigation::pimcoreNavigation PHP Метод

pimcoreNavigation() публичный Метод

public pimcoreNavigation ( null $activeDocument = null, null $navigationRootDocument = null, null $htmlMenuIdPrefix = null, callable $pageCallback = null, $cache = true )
$activeDocument null
$navigationRootDocument null
$htmlMenuIdPrefix null
$pageCallback callable
    public function pimcoreNavigation($activeDocument = null, $navigationRootDocument = null, $htmlMenuIdPrefix = null, $pageCallback = null, $cache = true)
    {
        $controller = self::getController();
        if ($activeDocument) {
            // this is the new more convenient way of creating a navigation
            $navContainer = $controller->getNavigation($activeDocument, $navigationRootDocument, $htmlMenuIdPrefix, $pageCallback, $cache);
            $this->navigation($navContainer);
            $this->setUseTranslator(false);
            $this->setInjectTranslator(false);
            // now we need to refresh the container in all helpers, since the container can change from call to call
            // see also https://www.pimcore.org/issues/browse/PIMCORE-2636 which describes this problem in detail
            foreach ($this->_helpers as $helper) {
                $helper->setContainer($this->getContainer());
            }
            // just to be sure, ... load the menu helper and set the container
            $menu = $this->findHelper("menu");
            if ($menu) {
                $menu->setContainer($this->getContainer());
            }
            return $this;
        } else {
            // this is the old-style navigation
            return $controller;
        }
    }