Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Smarty - pierwsze starcie z problemami
Skobi
post 6.06.2004, 12:26:48
Post #1





Grupa: Zarejestrowani
Postów: 174
Pomógł: 1
Dołączył: 19.02.2004

Ostrzeżenie: (10%)
X----


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]
Go to the top of the page
+Quote Post
mike
post 6.06.2004, 12:32:12
Post #2





Grupa: Przyjaciele php.pl
Postów: 7 494
Pomógł: 302
Dołączył: 31.03.2004

Ostrzeżenie: (0%)
-----


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. ?>
Go to the top of the page
+Quote Post
Skobi
post 6.06.2004, 12:35:34
Post #3





Grupa: Zarejestrowani
Postów: 174
Pomógł: 1
Dołączył: 19.02.2004

Ostrzeżenie: (10%)
X----


działa!!!
dzięki i pozdrawiam
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Wersja Lo-Fi Aktualny czas: 24.07.2025 - 21:50