コード例 #1
0
ファイル: Datalist.php プロジェクト: goBrabus/form-manager
 /**
  * Converts the datalist to html code.
  *
  * @param string $prepend Optional string prepended to html content
  * @param string $append  Optional string appended to html content
  *
  * @return string
  */
 public function toHtml($prepend = '', $append = '')
 {
     //Do not print empty datalists
     if (!$this->count() && strlen($prepend . $append) === 0) {
         return '';
     }
     return parent::toHtml($prepend, $append);
 }
コード例 #2
0
ファイル: Fieldset.php プロジェクト: goBrabus/form-manager
 /**
  * {@inheritdoc}
  */
 public function offsetSet($offset, $value)
 {
     //Add the child to the parent
     if ($this->parent) {
         $this->parent->offsetSet($offset, $value);
     }
     //Add child to itself
     parent::offsetSet($offset, $value);
 }
コード例 #3
0
ファイル: Select.php プロジェクト: goBrabus/form-manager
 /**
  * {@inheritdoc}
  */
 public function html($html = null)
 {
     if ($html !== null) {
         parent::html($html);
     }
     $html = '';
     //render the options not belonging to optgroups
     foreach ($this->children as $option) {
         if ($option->getParent() === $this) {
             $html .= (string) $option;
         }
     }
     //render the optgroups
     if (!empty($this->optgroups)) {
         foreach ($this->optgroups as $optgroup) {
             $html .= (string) $optgroup;
         }
     }
     return $html;
 }
コード例 #4
0
ファイル: Container.php プロジェクト: goBrabus/form-manager
 /**
  * {@inheritdoc}
  *
  * @see ElementContainer::toHtml
  */
 protected function defaultRender($prepend = '', $append = '')
 {
     return parent::toHtml($prepend, $append);
 }