Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: Smarty - pierwsze starcie z problemami
Forum PHP.pl > Forum > PHP
Skobi
Witam,
wlasnie zaczalem poznawać biblioteke smarty jednak mam problem z uruchomieniem pierwszego skryptu a mianowicie:

struktura katalogu:

www
------ demo
----------- cache
----------- configs
----------- templates
---------------- index.tpl
----------- templates_c
----------- index.php
------ libs


zawartość pliku index.php:


[php:1:8975966fe3]
<?php

define('SMARTY_DIR', '../libs/');
require(SMARTY_DIR.'Smarty.class.php');

$smarty = new Smarty;

$smarty->template_dir = $_home_path.'/templates/';
$smarty->compile_dir = $_home_path.'/templates_c/';
$smarty->config_dir = $_home_path.'/configs/';
$smarty->cache_dir = $_home_path.'/cache/';


$smarty->assign('title', 'test strony');
$smarty->assign('text', 'ble ble ble');
$smarty->display( 'index.tpl' );

?>[/php:1:8975966fe3]

zawartość pliku index.tpl:

<html>
<head>
<title>{$title}</title>
</head>
<body>
{$text}
</body>
</html>


i wywala mi taki blad:


Warning: Smarty error: unable to read resource: "index.tpl" in c:foxservwwwsmartylibsSmarty.class.php on line 1102


co moze być nie tak?[color=darkred][/color]
mike
Sprawdź tak:
  1. <?php
  2. $smarty->template_dir = $_home_path.'../demo/templates/'; 
  3. $smarty->compile_dir = $_home_path.'../demo/templates_c/'; 
  4. $smarty->config_dir  = $_home_path.'../demo/configs/'; 
  5. $smarty->cache_dir = $_home_path.'../demo/cache/';
  6. ?>
Skobi
działa!!!
dzięki i pozdrawiam
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.