Example #1
0
 /**
  * @return mixed
  */
 public function getContent()
 {
     $content = new \HtmlObject\Element('div');
     $content->setChild(new \HtmlObject\Element('p', $this->content));
     if ($this->link) {
         $content->setChild(id(new \HtmlObject\Link($this->link, t('Learn More')))->target('blank'));
     }
     if ($this->guide) {
         $button = new \HtmlObject\Link($this->link, t('Launch Guide'));
         $button->addClass('btn btn-info btn-sm')->href('#')->setAttribute('data-launch-guide', $this->guide);
         $content->setChild($button);
     }
     return $content;
 }
Example #2
0
 protected function setUp()
 {
     if (!class_exists('URL')) {
         Mockery::mock('alias:URL');
     }
     HtmlObject\Image::$urlGenerator = static::getURL();
     HtmlObject\Link::$urlGenerator = static::getURL();
     static::getURL();
     static::getApp();
 }
Example #3
0
 public function testCanManipulateComplexStructures()
 {
     $object = Element::div(array('title' => Element::div('foo')->class('title'), 'body' => Element::div()->class('body')));
     $wrapper = HtmlObject\Link::create('#', '');
     $object = $object->wrapWith($wrapper, 'complex');
     $render = $object->openOn('complex.body') . 'foo' . $object->close();
     $this->assertEquals('<a href="#"><div><div class="title">foo</div><div class="body">foo</div></div></a>', $render);
 }