Horde_Form::addVariable PHP Method

addVariable() public method

TODO
public addVariable ( $humanName, $varName, $type, $required, $readonly = false, $description = null, $params = [] )
    function addVariable($humanName, $varName, $type, $required, $readonly = false, $description = null, $params = array())
    {
        return $this->insertVariableBefore(null, $humanName, $varName, $type, $required, $readonly, $description, $params);
    }

Usage Example

Example #1
0
function prepareImportForm($p_variables, &$p_statement_file_variable)
{
    $v_form = new Horde_Form($p_variables, 'Import Statement', 'import_statement');
    $p_statement_file_variable = $v_form->addVariable('Statement File (CSV)', 'statement_file', 'file', TRUE);
    $v_file_description = '<p>The file must conform to the CSV standard and contain only ' . 'printable, UTF-8 characters.</p>' . '<p>Fields are:</p>' . '<ul><li>Item ID (unique)</li><li>Account Name</li>' . '<li>Item Type (O: opening balance, E: event, C: closing balance)</li>' . '<li>Description</li><li>Amount</li></ul>';
    $v_file_description_variable = $v_form->addVariable('', 'description', 'html', FALSE, TRUE);
    $v_file_description_variable->setDefault($v_file_description);
    $v_form->setButtons('import');
    return $v_form;
}
All Usage Examples Of Horde_Form::addVariable