2001-01-22 19:17:11 +00:00
|
|
|
GENERAL
|
|
|
|
-------
|
|
|
|
|
|
|
|
Q: What is Smarty?
|
|
|
|
A: Smarty is a template engine for PHP... but be aware this isn't just another
|
|
|
|
PHP template engine. It's much more than that.
|
|
|
|
|
|
|
|
Q: What's the difference between Smarty and other template engines?
|
|
|
|
A: Most other template engines for PHP provide basic variable substitution and
|
|
|
|
dynamic block functionality. Smarty takes a step further to be a "smart"
|
|
|
|
template engine, adding features such as configuration files, template
|
|
|
|
functions, variable modifiers (see the docs!) and making all of this
|
|
|
|
functionality as easy as possible to use for both programmers and template
|
2001-01-22 19:22:24 +00:00
|
|
|
designers. Smarty also compiles the templates into PHP scripts, eliminating
|
|
|
|
the need to parse the templates on every invocation, making Smarty extremely
|
|
|
|
scalable and managable for large application needs.
|
2001-01-22 19:17:11 +00:00
|
|
|
|
|
|
|
Q: What do you mean "Compiled PHP Scripts" ?
|
2001-01-29 23:08:50 +00:00
|
|
|
A: Smarty reads the template files and creates PHP scripts from them. Once
|
|
|
|
these PHP scripts are created, Smarty executes these, never having to parse
|
|
|
|
the template files again. If you change a template file, Smarty will
|
|
|
|
recreate the PHP script for it. All this is done automatically by Smarty.
|
|
|
|
Template designers never need to mess with the generated PHP scripts or even
|
|
|
|
know of their existance.
|
2001-01-22 19:17:11 +00:00
|
|
|
|
2001-01-26 17:47:59 +00:00
|
|
|
Q: Do you have a mailing list?
|
2001-01-29 23:08:50 +00:00
|
|
|
A: Yes. Subscribe by sending an e-mail to subscribe-smarty@lists.ispi.net. This
|
|
|
|
is also archived at http://marc.theaimsgroup.com/ under www/smarty
|
2001-01-26 17:47:59 +00:00
|
|
|
|
2001-01-19 16:10:06 +00:00
|
|
|
TROUBLESHOOTING
|
|
|
|
---------------
|
|
|
|
|
2001-01-21 22:17:28 +00:00
|
|
|
Q: Smarty doesn't work.
|
|
|
|
A: You must be using PHP 4.0.4pl1 or later to fix all known problems
|
2001-01-22 19:22:24 +00:00
|
|
|
Smarty has with PHP. Read the BUGS file for more info.
|
2001-01-21 22:17:28 +00:00
|
|
|
|
2001-01-19 16:10:06 +00:00
|
|
|
Q: Smarty is recompiling my templates on every invocation.
|
2001-01-21 22:17:28 +00:00
|
|
|
A: This is a bug that was fixed in 1.0a, grab the latest tarball.
|
2001-01-19 16:10:06 +00:00
|
|
|
|
|
|
|
Q: I get the following error when running Smarty:
|
|
|
|
Warning: Wrong parameter count for preg_replace() in
|
|
|
|
Smarty.class.php on line 371
|
|
|
|
A: preg_replace had a parameter added in PHP 4.0.2 that Smarty
|
2001-01-21 22:17:28 +00:00
|
|
|
requires. Upgrade to at least 4.0.4pl to fix all known PHP issues with
|
2001-01-19 16:10:06 +00:00
|
|
|
Smarty.
|
2001-01-21 22:17:28 +00:00
|
|
|
|
|
|
|
Q: I get the following error when running Smarty:
|
|
|
|
Fatal error: Failed opening required 'PEAR.php'
|
2001-01-22 15:00:09 +00:00
|
|
|
(include_path='') in Config_File.class.php on line 3
|
|
|
|
A: Smarty uses the PEAR libraries for some of its error handling routines.
|
|
|
|
PEAR libraries come with the distribution of PHP. Be sure that the path to
|
|
|
|
these libraries is included in your php include_path. Unix users check
|
|
|
|
/usr/local/lib/php. Windows users check C:/php/pear.
|
2001-01-21 22:17:28 +00:00
|
|
|
|
2001-01-26 19:35:15 +00:00
|
|
|
Q: I get this error when passing variables to {include}:
|
|
|
|
Fatal error: Call to undefined function: get_defined_vars() in
|
|
|
|
/path/to/Smarty/templates_c/index.tpl.php on line 8
|
|
|
|
A: get_defined_vars() was added to PHP 4.0.4. If you plan on passing
|
|
|
|
variables to included templates, you will need PHP 4.0.4 or later.
|