Re: [SMARTY] Re: Blank page - no errors while extending Smarty
| From: | boots | Date: | Thu, 12 Aug 2004 21:45:50 +0000 |
| Subject: | Re: [SMARTY] Re: Blank page - no errors while extending Smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11675@lists.php.net to get a copy of this message | ||
--- Monte Ohrt <monte@ispi.net> wrote:
> Smarty isn't meant to be executed statically, you should have an
> instantiated object.
Hmm. If I'm not mistaken, in PHP4, $this (of the current object, in
this case the extended object) would be in context during the
Smarty::display(). It seems reasonable that this should continue to be
the case for PHP5--is that not so? Still, I think that $this-> or
parent:: are more appropriate here.
Someone mentioned the constructor: I haven't tried this, so I ask: is
it advisable to avoid __construct() when extending a class (like
Smarty) that uses the PHP4 style class-named constructors?
> Ryan Kanno wrote:
>
> >
> > Thanks to all that responded. I spent yesterday debugging and
> here's
> > what I found. If I override the 'fetch' function in my extended
> > Smarty class, regardless of what's called within the function, I
> get
> > the blank page with no error output. Here's what the fetch
> function
> > looked like:
> >
> > public function fetch() {
> > return Smarty::fetch(...);
> > }
> >
> > If I comment that function out, then everything works as normal. I
>
> > didn't run through the Smarty code yet, but is there something in
> > Smarty that would account for this behavior?
> >
> > Thanks,
> > Ryan