예제 #1
0
 public function renderPartial()
 {
     $content = $this->getContent() ? $this->getContent() : $this->element->renderPartial();
     $this->setContent('');
     switch ($this->placement) {
         case self::PLACEMENT_AFTER:
             return $content . parent::render();
         case self::PLACEMENT_WRAP:
             $this->setContent($content);
             return parent::render();
         case self::PLACEMENT_BEFORE:
         default:
             return parent::render() . $content;
     }
 }
예제 #2
0
 public function render()
 {
     $this->setName('');
     $this->setContent($this->getValue());
     $this->setValue('');
     return parent::render();
 }
예제 #3
0
 public function renderPartial()
 {
     if ($this->getContent() === null) {
         $this->setContent('');
     }
     return parent::renderPartial();
 }
예제 #4
0
 public function render()
 {
     if ($this->getTag() == 'button') {
         $this->setContent($this->getLabel());
     } elseif ($this->getTag() == 'input') {
         $this->setValue($this->getLabel());
     }
     $this->setLabel(null);
     return parent::render();
 }
예제 #5
0
 /**
  * 
  * @return string
  */
 public function render()
 {
     if ($this->elements) {
         foreach ($this->elements as $element) {
             $this->append($element->render(), $this->getContent() ? ' ' : '');
         }
     }
     $this->setName('');
     return parent::render();
 }
예제 #6
0
 public function renderPartial()
 {
     $this->setAttrib('type', 'radio');
     $disabled = $this->getAttrib('disabled') ? ' disabled' : '';
     $divClass = 'radio';
     if ($this->hasClass('radio-inline')) {
         $divClass .= '-inline';
         $this->removeClass('radio-inline');
     }
     $html = '<div class="' . $divClass . $disabled . '"><label>' . parent::renderPartial() . ' ' . $this->getLabel() . '</label></div>';
     return $html;
 }
예제 #7
0
 public function renderPartial()
 {
     $this->setAttrib('type', 'checkbox');
     $hidden = $this->insertHiddenUncheckedValue ? new Hidden($this->getName(), ['value' => 0, 'id' => '']) : '';
     $disabled = $this->getAttrib('disabled') ? ' disabled' : '';
     $divClass = 'checkbox';
     if ($this->hasClass('checkbox-inline')) {
         $divClass .= '-inline';
         $this->removeClass('checkbox-inline');
     }
     $html = '<div class="' . $divClass . $disabled . '"><label>' . $hidden . parent::renderPartial() . ' ' . $this->getLabel() . '</label></div>';
     return $html;
 }
예제 #8
0
 public function render()
 {
     if ($this->items) {
         foreach ($this->items as $key => $value) {
             if (is_array($value)) {
                 $this->append($this->renderOptGroup($key, $value));
             } else {
                 $this->append($this->renderItem($key, $value));
             }
         }
     }
     $this->removeAttrib('value');
     return parent::render();
 }
예제 #9
0
 public function render()
 {
     $this->setContent('');
     if ($this->items) {
         foreach ($this->items as $item) {
             if ($item->getValue() == $this->getValue()) {
                 $item->check();
             }
             $this->append($item->render());
         }
     }
     $this->removeAttrib('name');
     $this->removeAttrib('value');
     $this->addClass('checkbox-group');
     return parent::render();
 }