set_label() public method

Set the group label.
public set_label ( string $label )
$label string If null, the label will be generated from the group name
Example #1
0
 /**
  * Add a set/group of fields.
  */
 public function add_fields()
 {
     $argv = func_get_args();
     $argc = count($argv);
     if ($argc == 1) {
         $fields = $argv[0];
         $name = '';
         $label = null;
     } else {
         if ($argc == 2) {
             if (is_array($argv[0])) {
                 list($fields, $name) = $argv;
             } else {
                 list($name, $fields) = $argv;
             }
             $label = null;
         } else {
             if ($argc == 3) {
                 if (is_array($argv[0])) {
                     list($fields, $name, $label) = $argv;
                 } else {
                     list($name, $label, $fields) = $argv;
                 }
             }
         }
     }
     if (array_key_exists('_' . $name, $this->groups)) {
         Incorrect_Syntax_Exception::raise('Group with name "' . $name . '" in Complex Field "' . $this->get_label() . '" already exists.');
     } else {
         $group = new Group_Field();
         $group->set_name($name);
         $group->add_fields($fields);
         $group->set_label($label);
         $this->groups[$group->get_name()] = $group;
         return $this;
     }
 }