Example #1
0
 /**
  * @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));
 }
Example #2
0
 /**
  * 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);
 }
Example #3
0
 /**
  * @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);
 }
Example #4
0
 /**
  * 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);
 }
Example #5
0
 /**
  *
  * @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);
 }