/** * @param NavbarEntityContract $entity * @param array $attrs * * @return string */ private function renderBootstrapLink(NavbarEntityContract $entity, $attrs = []) { $attrs['class'] = $entity->class; $link = Html::tag('a', $attrs, $entity->renderBody($entity->renderIcon())); $container_attrs['title'] = $entity->title; if ($this->isActive($entity)) { $container_attrs['class'] = $this->config->active_link_class; } return Html::tag('li', $container_attrs, $link); }
/** * @dataProvider dataProviderFor_testTag * * @param string $name * @param array $attrs * @param string $body * @param string $expected */ public function testTag($name, $attrs, $body, $expected) { $this->assertEquals($expected, Html::tag($name, $attrs, $body)); }
/** * * @param NavbarEntityContract $entity * @param string $body * @return string */ protected function renderLinkContainer(NavbarEntityContract $entity, $body) { $container_attrs = []; if ($entity->title) { $container_attrs['title'] = $entity->title; } if ($this->isActive($entity)) { $container_attrs['class'] = $this->config->class_for_active_link; } return Html::tag($this->config->link_container_tag, $container_attrs, $body); }