Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.

Problem s path-om lib

[es] :: PHP :: Smarty template engine :: Problem s path-om lib

[ Pregleda: 2897 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Autor

Pretraga teme: Traži
Markiranje Štampanje RSS

xxxrugby

Član broj: 16068
Poruke: 653
*.adsl.net.t-com.hr.

Sajt: www.zagreb-rugby.hr


Profil

icon Problem s path-om lib02.02.2007. u 12:10 - pre 208 meseci
Problem.
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');    
    ?> 

xxxrugby: "We are all philosophers, when question is about politics!"
 
Odgovor na temu

xxxrugby

Član broj: 16068
Poruke: 653
*.adsl.net.t-com.hr.

Sajt: www.zagreb-rugby.hr


Profil

icon Re: Problem s path-om lib02.02.2007. u 14:17 - pre 208 meseci
Sorry na smetnji ah tok tok. i ja isto.
Pronasao sam u dokumentu do. pa sam rijesio,.

Code:
<?php

// put full path to Smarty.class.php
require('C:\Program Files\xampp\htdocs\testing_php\Smarty\libs\Smarty.class.php');
$smarty = new Smarty();

$smarty->template_dir = 'C:\Program Files\xampp\htdocs\testing_php\templates';
$smarty->compile_dir = 'C:\Program Files\xampp\htdocs\testing_php\templates_c';
$smarty->cache_dir = 'C:\Program Files\xampp\htdocs\testing_php\cache';
$smarty->config_dir = 'C:\Program Files\xampp\htdocs\testing_php\configs';

$smarty->assign('name', 'Ned');
$smarty->display('index.tpl');

?>

xxxrugby: "We are all philosophers, when question is about politics!"
 
Odgovor na temu

[es] :: PHP :: Smarty template engine :: Problem s path-om lib

[ Pregleda: 2897 | Odgovora: 1 ] > FB > Twit

Postavi temu Odgovori

Navigacija
Lista poslednjih: 16, 32, 64, 128 poruka.