Clickalicious\PhpMemAdmin\App::getHtmlNavigationEntry PHP Method

getHtmlNavigationEntry() protected method

Creates
  • elements HTML used for generating navigation entries for example.
  • Author: Benjamin Carl ([email protected])
    protected getHtmlNavigationEntry ( integer $action, string $title, string $glyphicon = '' ) : string
    $action integer The action of the entry
    $title string The text of the menu element
    $glyphicon string The optional glyphicon
    return string Generated HTML as string
        protected function getHtmlNavigationEntry($action, $title, $glyphicon = '')
        {
            // Retrieve the active host
            $host = $this->getActiveHost(true);
            // Build URL for action passed and active host!
            $url = $this->getUrl(array(self::ARGUMENT_ACTION => $action, self::ARGUMENT_HOST => $host[0] . ':' . $host[1]));
            // The name of the class
            $className = $action === $this->getAction() ? 'active' : '';
            // Render the HTML from template entry
            return $this->renderString($this->loadTemplates('navigation/entry'), array('glyphicon' => $glyphicon, 'url' => $url, 'title' => $title, 'className' => $className));
        }