View Full Version : Smarty Templating System
Josiah
06-09-2004, 05:48 PM
Joe or Nick --
Do you have PHP's Smarty installed on the servers? I've decided to build a website with Smarty, and I'm wondering if it will work.
Thanks,
Josiah
eugene
06-09-2004, 09:42 PM
Josiah-
You don't need to have Joe or Nick do anything to have Smarty for your own website.
Simply download and move the files into your HostPC account.
-Eugene
eugene
06-09-2004, 09:47 PM
If you place Smarty in one of your include dirs, then you can simply do the following at the beginning of your document:<?php
require('Smarty.class.php');
$ste = new Smarty;
?>
Otherwise, you can choose to use an absolute path, use a .htaccess directive, or define the SMARTY_DIR constant. Assuming you place the Smarty files in /home/josiah/domains/josiahmackenzie.com/Smarty/:
<?php
require('/home/josiah/domains/josiahmackenzie.com/Smarty/Smarty.class.php');
$ste = new Smarty;
?>OR<?php
define('SMARTY_DIR', '/home/josiah/domains/josiahmackenzie.com/Smarty/');
require(SMARTY_DIR . 'Smarty.class.php');
$ste = new Smarty;
?>
Josiah
06-09-2004, 10:27 PM
Very cool. Thanks!
Josiah
06-15-2004, 10:17 AM
Originally posted by eugene@Jun 9 2004, 07:47 PM
If you place Smarty in one of your include dirs
On HostPC servers, what is the "include directory"?
eugene
06-15-2004, 10:58 AM
Originally posted by Josiah+Jun 15 2004, 07:17 AM--></div><table border='0' align='center' width='95%' cellpadding='3' cellspacing='1'><tr><td>QUOTE (Josiah @ Jun 15 2004, 07:17 AM)</td></tr><tr><td id='QUOTE'> <!--QuoteBegin-eugene@Jun 9 2004, 07:47 PM
If you place Smarty in one of your include dirs
On HostPC servers, what is the "include directory"? [/b][/quote]
If you don't change anything, ".:/usr/local/lib/php".
<?= get_include_path(); ?>
You can change this in php via set_include_path():
set_include_path(get_include_path() . ":" . "/new/path/to/include");
You may also use .htaccess to adjust the include path.
php_value include_path .:/usr/local/lib/php:/new/path/to/include
Josiah
06-15-2004, 11:25 AM
Thank you!
vBulletin® v3.7.2, Copyright ©2000-2008, Jelsoft Enterprises Ltd.