Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [php][smarty], Mały problem przy smarty
...
post
Post #1





Grupa: Zarejestrowani
Postów: 16
Pomógł: 0
Dołączył: 1.10.2006

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


Witam, mam następujący problem z szablonami smarty:
  1. <?
  2. $smarty = new Smarty();
  3. $smarty->template_dir = "template";
  4. $smarty->compile_dir = "template/templates_c";
  5. $smarty->config_dir = "template/configs";
  6. $smarty->cache_dir = "template/cache";
  7. $smarty->caching = false;
  8. $smarty->left_delimiter = '<!--{';
  9. $smarty->right_delimiter = '}-->';
  10.  
  11. $smarty->assign("imie", "Lucyfer");
  12. $smarty->display("index.tpl");
  13. ?>

Użyłem tutaj <!--{ i }--> aby mi się z skryptami javascript nie gryzł.

W pliku index.tpl mam:
  1. (...) <!--{imie}-->


Problem jest taki że wyświetla mi błąd syntax error: unrecognized tag 'imie' (Smarty_Compiler.class.php, line 590). Dlaczego tak się dzieje? Przecież zmienna 'imie' została przypisana.
Go to the top of the page
+Quote Post
Adam Nowak
post
Post #2





Grupa: Zarejestrowani
Postów: 17
Pomógł: 0
Dołączył: 15.08.2007

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


Jak już coś to:
Kod
<!--{$imie}-->
btw: skoro Ci się gryzie z JS, skorzystaj z {literal}
Go to the top of the page
+Quote Post
Darti
post
Post #3





Grupa: Zarejestrowani
Postów: 1 076
Pomógł: 62
Dołączył: 6.03.2005
Skąd: Wroc

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


w tpl zrob
Kod
(...) <!--{$imie}-->


--------------------
The answer is out there, Neo. It's looking for you. And it will find you, if you want it to.
SERVER_SOFTWARE : Apache/2.2.4 (Win32) PHP/5.2.1
MySQL Client API version : 5.0.27
Go to the top of the page
+Quote Post
gutek84
post
Post #4





Grupa: Zarejestrowani
Postów: 116
Pomógł: 4
Dołączył: 9.10.2007
Skąd: Morąg

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


(...) <!--{$imie}-->
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 Aktualny czas: 22.08.2025 - 06:52