HTML_QuickForm::insertElementBefore()

HTML_QuickForm::insertElementBefore()

HTML_QuickForm::insertElementBefore() -- Inserts a new element right before the other element

Description

Inserts a new element right before the other element.

It is not possible to check whether the $element is already added to the form, therefore if you want to move the existing form element to a new position, you'll have to use removeElement():
$form->insertElementBefore($form->removeElement('foo', false), 'bar');

Parameter

object &$element

Element to insert (instance of HTML_QuickForm_element)

string $nameAfter

Name of the element before which the new one is inserted

Return value

return reference to inserted element.

Note

since 3.2.4

This function can not be called statically.

© Copyright 2003-2023 www.php-editors.com. The ultimate PHP Editor and PHP IDE site.