mirror of
https://github.com/smarty-php/smarty.git
synced 2025-08-04 10:24:26 +02:00
update QUICKSTART guide
This commit is contained in:
25
QUICKSTART
25
QUICKSTART
@@ -13,17 +13,24 @@ should understand the difference in your OS regarding file permissions.
|
||||
INSTALLATION
|
||||
------------
|
||||
|
||||
**
|
||||
Note: this installation procedure is quick and dirty, it is meant to get Smarty
|
||||
working just to see it work. The installation procedure from the Smarty
|
||||
documentation is much more complete, setting up Smarty in a way that is
|
||||
reusable for your applications and away from your web server document root.
|
||||
**
|
||||
|
||||
Unpack the Smarty tarball. You will see some files: Smarty.class.php,
|
||||
Smarty_Compiler.class.php, Config_File.class.php and a "plugins" directory. You
|
||||
will need all of these files somewhere in your PHP include path, so when you call
|
||||
require("Smarty.class.php") from within your application, it can find the
|
||||
class. Alternatively, you can set the SMARTY_DIR constant in your application,
|
||||
and Smarty will use that directory as the path to the Smarty class files. Be
|
||||
sure the SMARTY_DIR path ends with a slash!
|
||||
Smarty_Compiler.class.php, Config_File.class.php, debug.tpl and a "plugins"
|
||||
directory. You will need all of these files somewhere in your PHP include path,
|
||||
so when you call require("Smarty.class.php") from within your application, it
|
||||
can find the class. Alternatively, you can define the SMARTY_DIR constant in
|
||||
your application, and Smarty will use that directory as the path to the Smarty
|
||||
class files. Be sure the SMARTY_DIR path ends with a slash!
|
||||
|
||||
Now change directories somewhere inside of your web server document root. For
|
||||
this guide, we'll create a directory under the document root named "Smarty",
|
||||
and put all of our work here.
|
||||
this quick install guide, we'll create a directory under the document root
|
||||
named "Smarty", and put all of our work here.
|
||||
|
||||
$> cd /home/htdocs
|
||||
$> mkdir Smarty
|
||||
@@ -232,7 +239,7 @@ $smarty->display("index.tpl");
|
||||
--------- templates/index.tpl --------
|
||||
{include file="header.tpl" title="Home Page"}
|
||||
{section name=people loop=$FirstName}
|
||||
{$smarty.section.people.rownum} {$FirstName[people]} {$LastName[people]}<br>
|
||||
{$smarty.section.people.iteration} {$FirstName[people]} {$LastName[people]}<br>
|
||||
{sectionelse}
|
||||
There are no values to loop through.
|
||||
{/section}
|
||||
|
Reference in New Issue
Block a user