HTML_QuickForm::addElement()

HTML_QuickForm::addElement() -- Adds an element into the form

Synopsis

require_once 'HTML/QuickForm.php';

object &HTML_QuickForm::addElement (mixed $element)

Описание

Adds an element into the form. If $element is a string representing an element type, then this method accepts variable number of parameters, their meaning and count depending on element type.

Parameters starting from second will be passed to the element's constructor, consult the docs for the appropriate element to find out which parameters to pass.

Параметр

mixed $element

element object or type of element to add (text, textarea, file...)

Возвращаемое значение

return reference to added element

Throws

Таблица 42-1. Возможные значения PEAR_Error

Error codeError messageReasonSolution
QUICKFORM_UNREGISTERED_ELEMENTElement '$element' does not exist in HTML_QuickForm::_loadElement()Tried to add an element of unknown typeCheck the type name spelling or use HTML_QuickForm::registerElementType()
QUICKFORM_INVALID_ELEMENT_NAMEElement 'elementName' already exists in HTML_QuickForm::addElement()Tried to add an element having a name of an existing element, but of different typeChoose a different name for an element

Заметка

since 1.0

Эта функция не должна вызываться статически.


HIVE: All information for read only. Please respect copyright!
Hosted by hive йца: йХЕБЯЙЮЪ ЦНПНДЯЙЮЪ АХАКХНРЕЙЮ