Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> Smarty get
kiddy
post
Post #1





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 5.07.2007

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


Witam. Od pewnego czasu zacząłem używać smarty. Mam taki problem w pliku index.tpl Smarty ma mi includować odpowiedni plik zależnie od zawartości geta, mam takie coś
Kod
{if empty($smarty.get.id)}
{include file=zawartosc.tpl}
{else}
{include file=$smarty.get.id}
{/if}

Teraz jeżeli get jest pusty to wyświetla prawidłowo , ale jeżeli get już przybiera wartość np sonda to dostaje komunikat z errorem.
Kod
Warning: Smarty error: unable to read resource: "sonda" in /home/xxx/xxx/xxx/public_html/0.2/libs/Smarty.class.php on line 1092


Ten post edytował kiddy 12.10.2008, 11:27:11
Go to the top of the page
+Quote Post
piaseq
post
Post #2





Grupa: Zarejestrowani
Postów: 161
Pomógł: 25
Dołączył: 6.09.2008
Skąd: Warszawa

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


Po prostu smarty nie może odnaleźć szablonu, zapewne dlatego, że nie dodajesz rozszerzenia.
Spróbuj użyć
Kod
{include file="`$smarty.get.id`.tpl"}


Ten post edytował piaseq 12.10.2008, 13:15:38
Go to the top of the page
+Quote Post
kiddy
post
Post #3





Grupa: Zarejestrowani
Postów: 43
Pomógł: 0
Dołączył: 5.07.2007

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


Działa , dziękuję.
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: 26.08.2025 - 16:39