XOOPS  2.6.0
BlockForm.php
Go to the documentation of this file.
1 <?php
2 /*
3  You may not change or alter any portion of this comment or credits
4  of supporting developers from this source code or any supporting source code
5  which is considered copyrighted (c) material of the original comment or credit authors.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10 */
11 
12 namespace Xoops\Form;
13 
27 class BlockForm extends Form
28 {
32  public function __construct()
33  {
34  parent::__construct('', '', '');
35  }
36 
42  public function render()
43  {
44  $ret = '<div>';
45  /* @var $ele Element */
46  foreach ($this->getElements() as $ele) {
47  if (!$ele->isHidden()) {
48  $ret .= '<div class="row"><div class="span2"><strong>' . $ele->getCaption().'</strong></div>';
49  $ret .= '<div class="span4">' . $ele->render() . '<br />';
50  $ret .= '<em>' . $ele->getDescription() . '</em><br /></div></div>';
51  } else {
52  $ret .= $ele->render();
53  }
54  }
55  $ret .= '</div>';
56  return $ret;
57  }
58 }
getElements($recurse=false)
Definition: Form.php:232