Re: Re: HTML_Template_Flexy or Smarty

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Electroteque <daniel@xxxxxxxxxxxxxxxx>:
> no error handling ????

I should have qualified that. If you do something like:

    $smarty->display($filename);

and $filename does not exist, you get an error. When I say error
handling, I mean that I'd like for the method to return an error so I
can handle it gracefully (instead of an ugly developer error to the
screen, or if set to ~E_ALL, nothing sent to screen at all):

    $res = $smarty->display($filename);
    if (Smarty::isError($res)) {
        // Do something else
    }

> what i am asking, can it to standard template blocks aswell, like you 
> have a main template and can add template blocks from a seperate 
> template ? 

Yes -- {include file="someOther.tpl"}.

> and also can it be html programmer or designer friendly still say with
> simple vars like {myvar} instead of tedious logic that only a
> developer can understand ?

Yes: {$myvar} displays the contents of $myvar, if it is set and
non-empty.

Plus, there's a couple different loop handling constructs, if/then/else
statements, math stuff, and a number of specialty functions (my current
favorites: date_format and truncate).

Smarty is as complex as you want it to be; if you want to keep it
simple, it does that, too.

> On 16/12/2004, at 12:55 AM, Matthew Weier O'Phinney wrote:
>
> > * Electroteque <daniel@xxxxxxxxxxxxxxxx>:
> > > hi there I am trying to choose between the two, which one is
> > > efficient, but is also html programmer friendly and can still do
> > > template block style templating like fasttemplate or phemplate. I
> > > am trying to move people who have been using fasttemplate to a
> > > more efficient system, although  these two systems have logic
> > > inside the templating.
> >
> > You're verging on a religious war here...
> >
> > My predictions:
> > 1) 25% respond in favor of HTML_Template_Flexy
> > 2) 25% respond in favor of Smarty
> > 3) 25% respond in favor of different templating solutions altogether
> > 4) 25% respond asking why you need a templating system at all when you
> >    have PHP
> >
> > As for my own leanings -- we use Smarty where I work, and I like its
> > flexibility and the ease with which I can integrate it with regular 
> > HTML
> > (I particularly like that it doesn't use angle brackets as its
> > delimiters -- makes it easy to spot Smarty directives in the template).
> >
> > My one complaint about it: no error handling. I wish it had error
> > handling ala PEAR -- occasionally I get errors in Smarty that end up
> > being hard to debug due to the complexity of the templates and/or
> > number of templates we're using to generate a page.

-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux