Re: setting Flexy form error messages

From: Date: Mon, 01 Dec 2003 00:29:18 +0000
Subject: Re: setting Flexy form error messages
References: 1  Groups: php.pear.general php.pear.general 
Request: Send a blank email to pear-general+get-9226@lists.php.net to get a copy of this message
Those docs are horrifically out of date... The introduction has been updated a bit.. http://pear.php.net/manual/en/package.html.html-template-flexy.intro.php // template has this on it .. <input name="input" size="12"> $this->elements['input'] = new HTML_Template_Flexy_Element; // assign a value to it $this->elements['input']->setValue('Hello'); // to set errors: HTML_Template_Flexy_Factory::setErrors(array( 'input' => 'There was an error with input' )); the factory class is really a set of static methods to manipulate multiple elements. Getting these docs fixed is on my major TODO list.. Regards Alan Demian Turner wrote:
hi alan Can you give an example of how you've used Flexy's error message handling. From the flexy docs the example shows how this template html : <form name="theform"> <input name="theinput"> </form> gets transformed into: <FORM NAME="theform"> <INPUT NAME="theinput" VALUE="<?php echo htmlspecialchars($t->theform->theinput); ?>"><?php if (isset($this->errors['theform.theinput'])) { echo
    htmlspecialchars($this->errors['theform.theinput']); } ?>
</FORM> and in your examples file in CVS: <form name="test">
    Input<input name=test123
        ruleA="Test Text is a required field|required"
        ruleB="Test TextArea must be at least 5 characters|minlength|5">
gets transformed into: <?php echo $this->elements['test']->toHtmlnoClose();?>
    Input<?php echo $this->elements['test123']->toHtml();?>
Do you have an example showing the full sequence, from PHP object to template html, say with a typical User DataObject ? thanks demian
-- Can you help out? Need Consulting Services or Know of a Job? http://www.akbkhome.com

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