From 66c5c8862d57eea2cfbf0b616d6d03c97b847971 Mon Sep 17 00:00:00 2001 From: pete_morgan Date: Wed, 14 Sep 2005 19:42:23 +0000 Subject: [PATCH] Added Windows example and a few tweaks --- docs/en/getting-started.xml | 104 +++++++++++++++++++++--------------- 1 file changed, 61 insertions(+), 43 deletions(-) diff --git a/docs/en/getting-started.xml b/docs/en/getting-started.xml index bf6516a1..7504cd35 100644 --- a/docs/en/getting-started.xml +++ b/docs/en/getting-started.xml @@ -154,8 +154,8 @@ Basic Installation - Install the Smarty library files which are in the /libs/ directory of - the distribution. These are the PHP files that you SHOULD NOT edit. They + Install the Smarty library files which are in the /libs/ sub directory of + the distribution. These are PHP files that you SHOULD NOT edit. They are shared among all applications and they only get updated when you upgrade to a new version of Smarty. @@ -174,18 +174,19 @@ debug.tpl Smarty uses a PHP constant named - SMARTY_DIR which is the system - file path to the Smarty 'libs/' directory. Basically, if your application + SMARTY_DIR which is the + full system file path to the Smarty 'libs/' directory. + Basically, if your application can find the Smarty.class.php file, you do not need - to set SMARTY_DIR + to set the SMARTY_DIR, Smarty will figure it out on its own. Therefore, if Smarty.class.php is not in your include_path, or you do not supply an absolute path to it in your application, then you must - define SMARTY_DIR manually. SMARTY_DIR must include a - trailing slash. + define SMARTY_DIR manually. SMARTY_DIR must include a + trailing slash. - Here is how you create an instance of Smarty in your PHP scripts: + Here's how you create an instance of Smarty in your PHP scripts: @@ -193,8 +194,9 @@ debug.tpl ]]> @@ -206,13 +208,40 @@ $smarty = new Smarty; do one of the following: + + Set SMARTY_DIR constant manually + + +]]> + + + Supply absolute path to library file ]]> @@ -225,33 +254,22 @@ $smarty = new Smarty; ]]> - - Set SMARTY_DIR constant manually - - -]]> - - + Now that the library files are in place, it's time to setup the Smarty directories for your application. Smarty requires four directories which - are (by default) named 'templates/', + are by default named 'templates/', 'templates_c/', 'configs/' and 'cache/'. @@ -320,12 +338,12 @@ $smarty = new Smarty; Example file structure We need to create the 'index.tpl' file that Smarty will load. This will be - located in your $template_dir. + located in the $template_dir. @@ -386,7 +404,7 @@ chmod 770 /web/www.example.com/smarty/guestbook/cache/ {* Smarty *} -Hello, {$name}! +Hello, {$name} and welcome to Smarty! ]]> @@ -405,10 +423,10 @@ Hello, {$name}! - Now lets edit 'index.php'. We'll create an instance of Smarty, assign a - template variable and display the 'index.tpl' file. In our example - environment, "/usr/local/lib/php/Smarty" is in our include_path. Be sure you - do the same, or use absolute paths. + Now lets edit 'index.php'. We'll create an instance of Smarty, + assign a + template variable and display + the 'index.tpl' file. @@ -418,9 +436,9 @@ Hello, {$name}! template_dir = '/web/www.example.com/smarty/guestbook/templates/'; $smarty->compile_dir = '/web/www.example.com/smarty/guestbook/templates_c/'; @@ -449,7 +467,7 @@ $smarty->display('index.tpl'); - Now load the index.php file from your web browser. + Now naviagate to the index.php file with the web browser. You should see "Hello, Ned!"