コード例 #1
0
ファイル: HeaderView.php プロジェクト: qubes/defero
 public function render()
 {
     // Main nav
     $nav = new Nav(Nav::NAV_DEFAULT);
     $nav->addItem(new NavItem(new HtmlElement("a", ["href" => "/wizard"], "<strong>**Wizard**</strong>"), $this->_getNavItemState("/wizard")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/campaigns"], "Campaigns"), $this->_getNavItemState("/campaigns")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/contacts"], "Contacts"), $this->_getNavItemState("/contacts")))->addItem(new NavItem(new HtmlElement("a", ["href" => "/stats"], "Stats"), $this->_getNavItemState("/stats")));
     // Global typeahead search
     $searchForm = (new TypeAheadSearchFormView(TypeAheadEnum::ALL()))->setNavBarSearch();
     // Logo or brand
     $brand = new HtmlElement("a", ["class" => "brand", "href" => "/"], "Defero");
     return $brand . $nav . $searchForm;
 }
コード例 #2
0
 public function __construct(TypeAheadEnum $typeAheadEnum = null, $placeholder = "Search...")
 {
     $this->_typeAheadEnum = $typeAheadEnum ?: TypeAheadEnum::ALL();
     $this->_placeholder = $placeholder;
 }