芝麻web文件管理V1.00
编辑当前文件:/home/strato/chroot/opt/RZphp80/includes/doc/HTML_QuickForm2/examples/default-renderer.php
HTML_QuickForm2 default renderer example
addFieldset()->setLabel('Your information'); $username = $fs->addText('username')->setLabel('Username'); $username->addRule('required', 'Username is required'); $password = $fs->addPassword('pass') ->setLabel(array('Password', 'Password should be 8 characters at minimum')); $password->addRule('required', 'Password is required'); $form->addHidden('my_hidden1')->setValue('1'); $form->addHidden('my_hidden2')->setValue('2'); $form->addSubmit('submit', array('value' => 'Send', 'id' => 'submit')); if ($form->validate()) { $form->toggleFrozen(true); } $renderer = HTML_QuickForm2_Renderer::factory('default') ->setOption(array( 'group_hiddens' => true, 'group_errors' => true, 'required_note' => '
Note:
Required fields are marked with an asterisk (
*
).' )) ->setTemplateForId('submit', '
{element} or
Cancel
') ->setTemplateForClass( 'HTML_QuickForm2_Element_Input', '
{error}
' . '
{label}
' . '{element}' . '
{label_2}
' ); echo $form->render($renderer); ?>