For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > August 2004 > Re: [SMARTY] Re: Blank page - no errors while extending Smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] Re: Blank page - no errors while extending Smarty
Monte Ohrt

2004-08-12, 8:59 pm

Smarty isn't meant to be executed statically, you should have an
instantiated object.

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
>
> ________________________________________
_________________________
> Is your PC infected? Get a FREE online computer virus scan from
> McAfeeŽ Security.
> http://clinic.mcafee.com/clinic/ibu...gn.asp?cid=3963
>

Boots

2004-08-12, 8:59 pm

--- 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?
[color=darkred]
> Ryan Kanno wrote:
>
> here's
> get
> function
>
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com