Repo: 展示头部导航

@param array $nav
@param null|string $title
542433
public function displayHeader(array $nav, $title = null)
    {
        $links = $this->groupBySide($nav['links']);
        $this->view->display('@nav/navs/header.php', [
            'nav' => $nav,
            'title' => $title,
            'leftLinks' => $this->renderLinks($links['left']),
            'rightLinks' => $this->renderLinks($links['right']),
        ]);
    }
351508
protected function _setTitleAttr($title, array $options = [])
    {
        if (!Arr::key('title', $options)) {
            $options['title'] = strip_tags($title);
        }

        return $options;
    }
875451
private static function PrefixEnumerator( $nav )
	{
		/**
		 * @var XmlNamespaceManager $nsmgr
		 */
		$$nsmgr = new XmlNamespaceManager();
		ExtFuncs::ScanLocalNamespaces( $nsmgr, $nav->CloneInstance(), false );

		foreach ( $nsmgr->getNamespacesInScope( XmlNamespaceScope::All ) as $prefix => $ns )
		    yield XPath2Item::fromValue( $prefix );
	}
1082857
public static function title($title = null)
    {
        if (is_null($title)) {
            $title = config('app.title');
        }

        $tag = static::open('title');
        $tag .= $title;
        $tag .= static::close();

        return $tag;
    }
999096
protected function MoveToNext( $nav )
	{
		$result = $nav->MoveToNextAttribute();

		if ( $result && $this->skip( $nav ) )
		{
			return $this->MoveToNext( $nav );
		}

		return $result;
	}
473545
public function set_title($title) {
        $title = format_string($title);
        $title = strip_tags($title);
        $title = str_replace('"', '&quot;', $title);
        $this->_title = $title;
    }
726898
public static function save($title = null)
    {
        $toolbar = Toolbar::getInstance(self::$_toolbar);
        $title   = (empty($title)) ? __d('core', 'Save') : $title;

        $toolbar->appendButton('Core.action', $title, self::ACTION_SAVE, [
            'icon'      => 'check',
            'class'     => 'jsFormButton',
            'iconClass' => 'ckTextGreen',
            'button'    => 'grey lighten-3',
        ]);
    }
1105547
public function getRoot($title)
    {
        if (array_key_exists($title, $this->menu)) {
            return $this->menu[$title];
        }

        return null;
    }
498112
public function title(string $title)
    {
        $name = config('app.name');

        if (empty($this->subject) && ! is_null($name)) {
            $this->subject(sprintf('[%s] %s', $name, $title));
        }

        $this->title = $title;

        return $this;
    }
1205175
public function setTitle($title)
    {
        $this->title = $title;

        $this->getViewService()->share('title', $this->getTitle());
    }
1038860
public function menuItemLabel($title = null) {
		$result = '';
		if (empty($title)) {
			return $result;
		}

		$result = $this->Html->tag('span', $title, ['class' => 'menu-item-label visible-xs-inline']);

		return $result;
	}
63644
public function updateTreeTitle(&$title)
    {
        if ($this->owner->AccessAllSubsites) {
            $title = _t(__CLASS__ . '.GlobalGroup', 'global group');
            $title = htmlspecialchars($this->owner->Title, ENT_QUOTES) . ' <i>(' . $title . ')</i>';
        } else {
            $subsites = Convert::raw2xml(implode(', ', $this->owner->Subsites()->column('Title')));
            $title = htmlspecialchars($this->owner->Title) . " <i>($subsites)</i>";
        }
    }
1307139
public function addNewDeployKey(string $title, string $key): array
    {
        return $this->getApi()->request($this->getApi()
                                             ->sprintf('/repos/:owner/:repo/keys', $this->getRepositories()->getOwner(),
                                                 $this->getRepositories()->getRepo()), Request::METHOD_POST, [
                'title' => $title,
                'key'   => $key
            ]);
    }
1127212
public function getNavUrls($nav = null)
    {
        // If no nav passed, as it would be for a sub navs, get the configed nav
        if (empty($nav)) {
            $nav = config('decoy.site.nav');
        }

        // Allow for the nav to be acallable
        if (is_callable($nav)) {
            $nav = call_user_func($nav);
        }

        // Loop through the nav
        $flat = [];
        foreach ($nav as $val) {
            if (is_array($val)) {
                $flat = array_merge($flat, $this->getNavUrls($val));
            } else {
                $flat[] = $val;
            }
        }

        return $flat;
    }
972150
private function logSection($title = "")
    {
        $this->logger->info("---------------------------");
        if (!empty($title)) {
            $this->logger->info($title);
        }
    }
904887
public function handleTitle($title)
    {
        if (is_null($request = $this->getRequest()) || empty($this->titles)) {
            return $title;
        }

        if (in_array($action = $request->get('action'), array_keys($this->titles))) {
            return $this->titles[$action];
        }

        return $title;
    }
402973
public function setTitle( $title, $mode = 'set', $separator = ' | ' )
	{
		if( $mode == 'append' || $mode === 1 )
			$title	= $this->title.$separator.$title;
		else if( $mode == 'prepend' || $mode === -1 )
			$title	= $title.$separator.$this->title;
		$this->title	= $title;
	}