コード例 #1
0
ファイル: FormTableView.php プロジェクト: brick/app
 /**
  * Renders the errors of a Form or an Element as an unordered list.
  *
  * @param \Brick\Form\Base $base
  *
  * @return string
  */
 private function renderErrors(Base $base)
 {
     if (!$base->hasErrors()) {
         return '';
     }
     $html = '';
     foreach ($base->getErrors() as $error) {
         $li = new Tag('li');
         $li->setTextContent($error);
         $html .= $li->render();
     }
     $ul = new Tag('ul');
     $ul->setHtmlContent($html);
     return $ul->render();
 }
コード例 #2
0
ファイル: Option.php プロジェクト: brick/form
 /**
  * {@inheritdoc}
  */
 public function render()
 {
     return $this->tag->setTextContent($this->content)->render();
 }
コード例 #3
0
ファイル: Button.php プロジェクト: brick/form
 /**
  * @param string $text
  *
  * @return static
  */
 public function setTextContent($text)
 {
     $this->tag->setTextContent($text);
     return $this;
 }