Re: Rendering to smarty with custom required/error templates producing smarty error
| From: | Adam Hubscher | Date: | Mon, 06 Dec 2004 01:14:49 +0000 |
| Subject: | Re: Rendering to smarty with custom required/error templates producing smarty error | ||
| References: | 1 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-16032@lists.php.net to get a copy of this message | ||
I had missed a few parts of the code when I changed some things to
$form.variable, however it still produces the same warning. I have
successfully gotten the html to render however.
"Adam Hubscher" <webmaster@offbeat-zero.net> wrote in message
news:20041206005934.53826.qmail@pb1.pair.com...
> Ok, thanks to y'all helping me find my stupid stupid mistake from before,
> now I come to one that I really have no idea why its happening.
>
> I produce this warning, after outputting the smarty template:
>
> Warning: Smarty error: eval: missing 'var' parameter in
> f:\PHP\Smarty\libs\Smarty.class.php on line 1088
>
> Now that I have the rules 100% working, I have the issue of displaying
them
> from within the smarty template. I defined the custom templates after
> setting up the renderer, like so:
>
> $this->renderer->setRequiredTemplate(
> '{if $error}
> <font color="red">{$label}</font>
> {else}
> {$label}
> {if $required}
> <font color="red" size="1">*</font>
> {/if}
> {/if}'
> );
> $this->renderer->setErrorTemplate(
> '{if $error}
> <font color="orange">{$error}</font><br />
> {/if}
> {$html}'
> );
> $this->form->setRequiredNote(
> * This field is mandatory');
>
> (this of course, being a basic one, since I've had problems with it just
> wanted to get it to work first)
>
> Since this is my first time actually using quickform with smarty, I
> consulted the starter written by the linux consultancy. However, utilizing
> his demo code, this doesnt work. I thought it might be with the fact that
> its using generic {$variable} terms, and not actually referring to the
> smarty form variable... however, afte attempting to add the $form.variable
> change to it, it still would not produce anything but that warning. It
also
> does not produce any label output on the form, only the elements.