mirror of
https://github.com/smarty-php/smarty.git
synced 2025-10-28 19:01:37 +01:00
52e80776c639a31fc0813c72f43f3f70a8131b2c
NAME:
Smarty - the PHP compiling template engine
VERSION: 1.0
AUTHORS:
Monte Ohrt <monte@ispi.net>
Andrei Zmievski <andrei@ispi.net>
SYNOPSIS:
require("Smarty.class.php");
$smarty = new Smarty;
$smarty->assign("Title","My Homepage");
$smarty->assign("Names",array("John","Gary","Gregg","James"));
$smarty->display("./templates/index.tpl");
DESCRIPTION:
What is Smarty?
Smarty is a template engine for PHP. One of the unique aspects about
Smarty that sets it apart from other templating solutions is that it
compiles the templates into native php scripts upon the first
execution. After that, it just executes the compiled PHP scripts.
Therefore, there is no costly template file parsing for each request.
Some of Smarty's features:
* it is extremely fast
* it is relatively simple since the PHP parser does the dirty work.
* no template parsing overhead, only compiles once.
* it is smart about recompiling only the template
files that have changed.
* you can make custom functions and custom variable modifiers, so
the template language is extremely extensible.
* configurable template delimiter tag syntax, so you can use
{}, {{}}, <!--{}-->, or whatever you like.
* template if/elseif/else/endif constructs are passed to the PHP parser,
so the if syntax can be as simple or as complex as you like.
* unlimited nesting of sections,ifs, etc. allowed
* it is possible to imbed PHP code right in your template files,
although not recommended and doubtfully needed since the engine
is so customizable.
REQUIREMENTS:
Smarty requires PHP 4 or later. Smarty was developed and tested
with 4.0.4pl1.
INSTALLATION:
* copy the Smarty.class.php, Smarty.addons.php and Config_File.class.php
scripts to a directory that is in your PHP include path.
* in the same directory as your php application,
create a "templates" directory and a "templates_c" directory.
Be sure the "templates_c" directory is writable by your
web server user (usually nobody), or chmod 777 the directory if
you are not sure.
* setup your php and template files. A good working example is
included to get you started.
BUGS:
There are no known bugs with Smarty, although there are some
bugs in PHP that cause problems with Smarty. preg_grep() previous
to 4.0.4 has a bug which Smarty has a built-in workaround for.
PHP 4.0.4 has a bug with user callbacks which would cause this
syntax in Smarty to crash PHP: {$varname|@modname}
Use PHP 4.0.4pl1 to fix this, or avoid using the "@" with
modifiers.
COPYRIGHT:
Copyright(c) 2000,2001 ispi. All rights reserved.
This software is released under the GNU General Public License.
Please read the disclaimer at the top of the Smarty.class.php file.
Languages
PHP
91.1%
Smarty
6.2%
Yacc
2.4%
Dockerfile
0.1%
Shell
0.1%