public static function create($name, $field, $properties = array(), $initial = Null) { // No late static binding as in PHP 5.3, otherwise we don't need // field and let user called BcForm_<Type> directly. $class_name = 'BcForm_' . BcForm::class_name($field); return new $class_name($name, $properties, $initial); }
public function add_field($name, $field, $properties = array(), $initial = Null) { $field_class_name = 'BcForm_' . BcForm::class_name($field); $this->fields[$name] = new $field_class_name($name, $properties, $initial); }