Re: Help requested - using HTML_Template_Sigma
| From: | Stephen Torri | Date: | Wed, 25 Jun 2003 15:13:09 +0000 |
| Subject: | Re: Help requested - using HTML_Template_Sigma | ||
| References: | 1 2 | Groups: | php.pear.general |
| Request: | Send a blank email to pear-general+get-6231@lists.php.net to get a copy of this message | ||
On Wed, 2003-06-25 at 01:06, Alexey Borzov wrote:
> Hi!
>
> Stephen Torri wrote:
>
> > ------------------------------
> > meta.inc.php3
> > ------------------------------
> > <?php
> >
> > function generate_meta ($tpl) {
> > $tpl->setCurrentBlock('meta');
> > $text = "<meta name=\"description\" content=\"Personal web page
> > of
> > Stephen A. Torri\">";
> >
> > $tpl->setVariable('meta_info',"Foo");
> > $tpl->parseCurrentBlock('meta');
> > }
> >
> > ?>
> >
> >
> > Yet the resulting HTML code does not have the 'meta' tag line in it. I
> > need assistance or a tutorial/howto page. What is wrong with this code?
>
> Well, you do need assistance but it has nothing to do with Sigma. ;]
> You should declare your generate_meta() like this:
>
> function generate_meta(&$tpl) {
> ...
> }
>
> Currently you are passing a *copy* of $tpl, and when you assign a variable to
> that, the original object is unaffected.
Amazing what six months away from PHP can do to a person. Thanks for the
answer. Thankfully you understood that I am trying to send the template
by reference to various "generate_..." functions.
Stephen
--
Stephen Torri <storri@sbcglobal.net>
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc
Attachment: [application/pgp-signature] This is a digitally signed message part signature.asc