Prolazim kroz instalaciju i mucim se vec pol dana da pokrenem demo.
Znaci necu stavljat Smarty po /lib/php nego ga stavljem u dir. svoje stranice.
znaci pod \testing_php\Smarty-2.6.16\
Ali nikako mi ne uspijeva. Uvijek imam gresku.
Warning: Smarty error: unable to read resource: "index.tpl" in C:\Program Files\xampp\htdocs\testing_php\Smarty-2.6.16\libs\Smarty.class.php on line 1095
Pa ako moze mala pomoc. Htio bi to tako napravit da simuliram stvarnu situaciju s hostinga.
Unutar index.php u rootu sam stavio pozivanje.
Code:
<?php
define('SMARTY_DIR', 'C:\\Program Files\\xampp\\htdocs\\testing_php\\Smarty-2.6.16\\libs\\');
define('SMARTY_DIR',str_replace("\\","/",getcwd()).'Smarty-2.6.16/libs/');
// load Smarty library
require_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/templates/';
$smarty->compile_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/templates_c/';
$smarty->config_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/configs/';
$smarty->cache_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/cache/';
$smarty->display('index.tpl');
?>
<?php
define('SMARTY_DIR', 'C:\\Program Files\\xampp\\htdocs\\testing_php\\Smarty-2.6.16\\libs\\');
define('SMARTY_DIR',str_replace("\\","/",getcwd()).'Smarty-2.6.16/libs/');
// load Smarty library
require_once(SMARTY_DIR . 'Smarty.class.php');
$smarty = new Smarty();
$smarty->template_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/templates/';
$smarty->compile_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/templates_c/';
$smarty->config_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/configs/';
$smarty->cache_dir = '/localhost/testing_php/smarty/Smarty-2.6.16/demo/cache/';
$smarty->display('index.tpl');
?>
xxxrugby: "We are all philosophers, when question is about politics!"