Beispiel #1
0
 public function __construct($name, $label, $members)
 {
     fxAssert::isArray($members, 'members') && fxAssert::isNotEmpty($members, 'members');
     parent::__construct($name, $label);
     $this->_members = $members;
     $this->id = $tmp = fxForm::_simplify($name);
     $this->name = $tmp . '[]';
     $this->_mmap = self::makeMemberMap($members);
 }
Beispiel #2
0
 /**
  * Takes an array of attributes ( name => values ) and creates an HTML formatted string from it.
  **/
 public function renderAtts($atts)
 {
     fxAssert::isArray($atts, '$atts');
     $o = '';
     if (!empty($atts)) {
         foreach ($atts as $k => $v) {
             $k = htmlspecialchars($k);
             // NULL values lead to output like <XYZ ... readonly ...>
             if (NULL === $v) {
                 $o .= " {$k}";
             } else {
                 $v = htmlspecialchars($v);
                 $o .= " {$k}=\"{$v}\"";
             }
         }
     }
     return $o;
 }