예제 #1
0
파일: Alert.php 프로젝트: cawaphp/bootstrap
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if ($this->isDismissible()) {
         $content = $this->getContent();
         $this->setContent('<button type="button" class="close" data-dismiss="alert" aria-label="Close">' . '<span aria-hidden="true">&times;</span></button>' . $content);
     }
     $return = parent::render();
     if (isset($content)) {
         $this->setContent($content);
     }
     return $return;
 }
예제 #2
0
파일: Table.php 프로젝트: cawaphp/bootstrap
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if ($this->responsive) {
         $div = new HtmlElement('<div>');
         $div->addClass('table-responsive');
         $div->setContent(parent::render());
         return $div->render();
     } else {
         return parent::render();
     }
 }
예제 #3
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->ul->clear();
     $this->ul->add($this->getLi(max(1, $this->current - 1), '&laquo;')->addClass('prev'));
     $min = 1;
     $max = $this->page;
     if ($this->page > $this->maxItem) {
         $min = max(1, $this->current - $this->maxItem / 2);
         $max = min($this->page, $this->current + $this->maxItem / 2);
     }
     if ($min - 1 >= 1) {
         $this->ul->add($this->getLi($min + 1, '...'));
     }
     for ($i = $min; $i <= $max; $i++) {
         $this->ul->add($this->getLi($i));
     }
     if ($max + 1 < $this->page) {
         $this->ul->add($this->getLi($max + 1, '...'));
     }
     $this->ul->add($this->getLi(min($this->page, $this->current + 1), '&raquo;')->addClass('next'));
     $this->setContent($this->ul->render());
     return parent::render();
 }
예제 #4
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     if (!isset($this->data['id'])) {
         $this->generateId();
     }
     $this->data['content'] = $this->elements->render();
     $phtml = $this->phtmlRender();
     if ($this->isStaticToTop()) {
         $phtml = (new HtmlElement('<div>'))->addClass('container')->setContent($phtml)->render();
     }
     $this->setContent($phtml);
     $return = parent::render();
     return $return;
 }
예제 #5
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->addAttribute('src', $this->getUrl());
     return parent::render();
 }
예제 #6
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->build();
     $this->setContent($this->header->render());
     return HtmlElement::render();
 }
예제 #7
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->content = $this->layout()->render();
     return parent::render();
 }
예제 #8
0
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $this->build();
     $this->setContent($this->header->render() . $this->body->render());
     return parent::render();
 }
예제 #9
0
 /**
  * @return string
  */
 public function render()
 {
     $this->element->setContent(json_encode($this->data));
     return $this->element->render();
 }