I got this from here: http://news.php.net/php.smarty.dev/2703
So.. here we go:
1. Download Smarty
2. Extract Smarty outside of
www
folder (ex: c:\wamp
). Rename the Smarty.x.x.x
folder to smarty.
3. Edit the
php.ini
file. To do this, left click on the wamp icon on the system tray, under php menu, there should be a php.ini
option.Here's an example of what you should put:
include_path = ".;c;\wamp\smarty\libs"
WARNING: Copy and pasting it created some errors for me. The single quotes and double quotes weren't working so I had to delete them and retype them. Also note the path of the folder!
4. Restart all services. You should see that option when you click on wamp icon on the system tray.
5. Ok, now in your root
www
create a folder name smarty
and within that folder create two folder named templates
and configs
. Outside of www
, within the c:/wamp/smarty
create these two folders templates_c
and cache
.Note: There's something about security but I'm only using for local host. Any live testing will always be on a Linux system.
6. In
www
or any subfolders within www
create a file any name you want, let's say index.html
.Here's the code for
index.html
:
Note: please look through the code and at the paths and try to understand it. Do not just copy and ignore it. Analyze it and type it out (copy and pasting might cause error dude to single and double quotes).
7. Now create the template file
index.tpl
(put it in www/smarty/templates
):index.tpl:
Look here: http://news.php.net/php.smarty.dev/2703. Blogspot will just parse out the html tags. So I cannot type it here.
0 comments:
Post a Comment