Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> smarty - 'Unable to load template file'
misty
post
Post #1





Grupa: Zarejestrowani
Postów: 366
Pomógł: 0
Dołączył: 2.01.2007

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


hej, zaczynam dopiero swoja przygode ze smarty. sciagnelam najnowszego z oficjalnej strony. utworzylam projekty 'smarty_test'.
w nim utworzylam katalog:

smarty (w nim podkatalogi config, plugins, templates, templates_c oraz skopiowalam tu katalog libs ze smartego. czyli mam tu jeszcze: plugins, sysplugins, Smarty.class.php, debug.tpl)

poza katalogiem utworzylam plik index.php:

  1. <?php
  2.  
  3. require('./smarty/Smarty.class.php');
  4.  
  5. $tpl = new Smarty;
  6. $tpl -> template_dir = './templates/';
  7. $tpl -> compile_dir = './templates_c/';
  8.  
  9. $tpl -> assign('data', date('d.m.Y'));
  10. $tpl -> display('test.tpl');
  11.  
  12. ?>


zas w katalogu template utworzylam plik test.tpl. Jednak gdy wchodze na strone: http://localhost/smarty_test/index.php

dostaje err:
Fatal error: Uncaught exception 'SmartyException' with message 'Unable to load template file 'test.tpl'' in C:\wamp\www\smarty_test\smarty\sysplugins\smarty_internal_template.php:162 Stack trace: #0 C:\wamp\www\smarty_test\smarty\sysplugins\smarty_internal_template.php(537): Smarty_Internal_Template->isExisting(true) #1 C:\wamp\www\smarty_test\smarty\Smarty.class.php(335): Smarty_Internal_Template->getRenderedTemplate() #2 C:\wamp\www\smarty_test\smarty\Smarty.class.php(379): Smarty->fetch('test.tpl', NULL, NULL, NULL, true) #3 C:\wamp\www\smarty_test\index.php(10): Smarty->display('test.tpl') #4 {main} thrown in C:\wamp\www\smarty_test\smarty\sysplugins\smarty_internal_template.php on line 162

nie chce mi zaladowac tego tpl. czy ktos z Was wie o co chodzi?? pytalam google ale nie znalazlam odp..
Go to the top of the page
+Quote Post
rootpak
post
Post #2





Grupa: Zarejestrowani
Postów: 5
Pomógł: 1
Dołączył: 17.11.2010

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


Cytat(misty @ 17.11.2010, 11:51:25 ) *
poza katalogiem utworzylam plik index.php...

zas w katalogu template utworzylam plik test.tpl


index.php nie widzi test.tpl - sprawdz jeszcze raz polozenie plikow.
Go to the top of the page
+Quote Post
nospor
post
Post #3





Grupa: Moderatorzy
Postów: 36 561
Pomógł: 6315
Dołączył: 27.12.2004




skoro wszystko masz w katalogu smarty to tak ma byc:
  1. $tpl -> template_dir = './smarty/templates/';
  2. $tpl -> compile_dir = './smarty/templates_c/';
Go to the top of the page
+Quote Post
misty
post
Post #4





Grupa: Zarejestrowani
Postów: 366
Pomógł: 0
Dołączył: 2.01.2007

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


dzieki
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 23.12.2025 - 09:15