/** * @dataProvider dataProviderFor_testPrefix * * @param string $string * @param string $prefix * @param string $expected */ public function testPrefix($string, $prefix, $expected) { $this->assertEquals($expected, Html::prefix($string, $prefix)); }
/** * Render class with or without prefix and/or postfix. * * @param string $prefix * @param string $postfix * * @return string */ public function renderClass($prefix = null, $postfix = null) { return Html::postfix(Html::prefix($this->class, $prefix), $postfix); }
/** * @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); }
/** * Render Title with or without prefix and postfix. * * @param string $prefix * @param string $postfix * @return string */ public function renderBody($prefix = null, $postfix = null) { return Html::postfix(Html::prefix($this->body, $prefix), $postfix); }
/** * * @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); }