Re: general question about smarty
| From: | Hojtsy Gabor | Date: | Wed, 23 May 2001 13:23:09 +0000 |
| Subject: | Re: general question about smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-787@lists.php.net to get a copy of this message | ||
> 1. Is it a standard, that i can also use when i switch to another
> language, such as java (jsp, python, ...), or is there a standard coming
> up?
I have not seen any cross-language template standards...
Also I don't think so Smarty will be such a language in the *near* future
> 2. Why should i learn a new "scripting language", if i can also use PHP
> instead of the smarty language. Just to replace the "<?php ?>" by
> "{}"?
Abstraction. You have pieces of codes you use everywhere...
You can put them in functions or classes, but (see the next answer)
> 3. Why is it better to use "{SMARTY_VARIABLE}" instead of "<?php
> print($variabelName) ?>", if i still am limited to use php behind,
> because smarty only runs on php, or am i wrong?
It is much easier for a designer to learn the {$VAR} syntax, and
there can be less errors in the code. Smarty introduces no secholes,
and if you disable the 'PHP code inside templates' features, designers
can't break the server with bad templates...
> 5. is the webdesigner really free from seeing source code, if he now
> gets to see another scripting language instead of php, the smarty
> language?
Designers can use any subset of the Smarty language.
You can use it the 'FastTemplate' way, where only the
{$VAR} syntax is enabled... Then why should you use
Smarty instead of 'FastTemplate'? Eg. because Smarty
beats FastTemplate in speed. :)
If you don't know 'FastTemplate': it is a widely used template
language, with the concept, that all the logic (loops,
conditions) should go to the code and not in the template.
Only a dymanic block functionality exists there...
Goba
........................................................... . . . . .
Editor of the Hungarian PHP manual, Admin of the Hungarian PHP mirror