コード例 #1
0
 /**
  * Sets a label.
  *
  * @param string $name   The field name
  * @param string $value  The label name (required - the default value is here because PHP do not allow signature changes with inheritance)
  */
 public function setLabel($name, $value = null)
 {
     if (2 == func_num_args()) {
         if (!isset($this->fields[$name])) {
             throw new InvalidArgumentException(sprintf('Unable to set the label on an unexistant widget ("%s").', $name));
         }
         $this->fields[$name]->setLabel($value);
     } else {
         // set the label for this widget schema
         parent::setLabel($name);
     }
 }