Re: QuickForm and templates RFC

From: Date: Fri, 21 Feb 2003 15:17:09 +0000
Subject: Re: QuickForm and templates RFC
References: 1 2  Groups: php.pear.general 
Request: Send a blank email to pear-general+get-3891@lists.php.net to get a copy of this message
Keith Pettit wrote:
Would love to see some output options. For example it would be great if there was a toggle in some of the form elements, for output. So if specified it would show the form element, or just plain text. This would help out tremendously when creating pages that have certian parts of forms that need to be restricted based on access or whatever. For example I could have some sort of auth system that did something like: if ($auth = admin){ $perm = 1 } else ($perm = 0) $form->addElement('text', 'somefield', 'Some Text', $perm); So in the above case 1 in the addElement would show them the form field, and 0 would show just text. Keith Well what about:
$element = $form->addElement('text','employerssalary' ....) if ($user->isJustSomeGuy()) { $element->freeze(); } Don't know if the syntax is correct but something like can difinitely be done. check out the freeze() method. Jeroen

« previous php.pear.general (#3891) next »