Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [smarty] get, include
krystian1991x
post
Post #1





Grupa: Zarejestrowani
Postów: 114
Pomógł: 0
Dołączył: 7.08.2010

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


jak mam wstawić zmienną zamiast nazwy pliku ?
  1. {include_php file=zmienna.php}


dodam że tak nie działa
  1. {include_php file="$zmienna.php"}

  1. {include_php file=$zmienna.php}

  1. {include_php file="$zmienna".php}


help !

Ten post edytował krystian1991x 15.10.2010, 12:37:50
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi
krystian1991x
post
Post #2





Grupa: Zarejestrowani
Postów: 114
Pomógł: 0
Dołączył: 7.08.2010

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




Fatal error: Uncaught exception 'Exception' with message 'Syntax Error in template "./templates/index.tpl" on line 36 "{include_php file=`$site`.php} " - Unexpected "`", expected one of: "{" , "$" , "identifier" , LDELIF , LDELFOR , LDELFOREACH , "closing tag" , INTEGER , "+" , "-" , "(" , "(!,not)" , TYPECAST , HEX , "." , SINGLEQUOTESTRING , "#" , "[" , """' in /home/edesing/public_html/libs/sysplugins/smarty_internal_templatecompilerbase.php:403 Stack trace: #0 /home/edesing/public_html/libs/sysplugins/smarty_internal_templateparser.php(2669): Smarty_Internal_TemplateCompilerBase->trigger_template_error() #1 /home/edesing/public_html/libs/sysplugins/smarty_internal_templateparser.php(2734): Smarty_Internal_Templateparser->yy_syntax_error(75, '`') #2 /home/edesing/public_html/libs/sysplugins/smarty_internal_smartytemplatecompiler.php(49): Smarty_Internal_Templateparser->doParse(75, '`') #3 /home/edesing/public_html/libs/sysplugins/smarty_internal_templatecompilerbase.php(82): Smarty_Internal_SmartyTemplateCompiler->do in /home/edesing/public_html/libs/sysplugins/smarty_internal_templatecompilerbase.php on line 403


widzisz żeby działało ?!

  1. {$smarty.get.id}
  2.  
  3. {if $smarty.get.id !=""}
  4. {include_php file="`$smarty.get.id`.php"}
  5. {/if}


ok zrobiłem to aktualnie tak i niby działa ale zawartość na dole nie ulega zmianie tylko za pierwszym razem ładuje mi np jak wczytam news.php to mi wyswietla juz caly czas to i nie moge zmienić na żadną inną podstronę za to cały czas ulega zmianie luźno wrzucona zmienna na nazwy podstron ...
Go to the top of the page
+Quote Post

Posty w temacie
- krystian1991x   [smarty] get, include   14.10.2010, 23:53:20
- - nospor   Mi bez problemu działa ta metoda: {include_php fil...   15.10.2010, 06:03:38
- - krystian1991x   ta zmienna jest przekazywana jako get z pliku tpl ...   15.10.2010, 12:38:40
- - rocktech.pl   Widzę, że nie jesteś uważnym słuchaczem. Moja odpo...   15.10.2010, 12:50:55
- - krystian1991x   Fatal error: Uncaught exception 'Exception...   15.10.2010, 13:19:33
- - rocktech.pl   Wedle tego powinno zadziałać. Coś ci się źle par...   15.10.2010, 13:27:31
- - krystian1991x   to prowadzi mnie do punktu wyjścia a pisałem wyżej...   15.10.2010, 15:06:33
- - rocktech.pl   Pokaż cały kod w obecnej postaci. .php i .tpl. Zer...   15.10.2010, 15:28:12
- - krystian1991x   index.php [PHP] pobierz, plaintext <?phpsession...   15.10.2010, 15:34:40
- - rocktech.pl   Ok pokaż jeszcze co się dzieje w pliku np. news.ph...   15.10.2010, 15:50:53
- - krystian1991x   [PHP] pobierz, plaintext <?php session_start...   15.10.2010, 16:08:35
- - rocktech.pl   No i wyszło szydło z worka. To co się dzieje w pli...   15.10.2010, 16:35:53
- - krystian1991x   zrobiłem tak jak napisałeś ale cóż nie działa   15.10.2010, 16:55:43
- - rocktech.pl   1. Jakie błędy wywala? 2. index.php?id=news - tera...   15.10.2010, 17:07:11
- - krystian1991x   nie wywala błędów a dubluje mi news.php czyli wyśw...   15.10.2010, 17:12:44
- - rocktech.pl   To do wywalenia z index.php zakładając, że kod log...   15.10.2010, 17:13:36
- - krystian1991x   nie login.php jest osobno ładowany i nie jest pod ...   15.10.2010, 17:15:00
- - rocktech.pl   Możesz pokazać kod pliku login.php ?   15.10.2010, 17:24:23
- - krystian1991x   [PHP] pobierz, plaintext <?php session_start...   15.10.2010, 17:26:38
- - rocktech.pl   Nie wiem dlaczego się upierasz żeby całą logikę ap...   15.10.2010, 17:47:00
- - krystian1991x   ale co ma do tego login.php ? skoro nawet jak go n...   15.10.2010, 17:54:04
- - rocktech.pl   Kiedy ci tłumacze, że robisz wszytko źle i cała ob...   15.10.2010, 18:58:23
- - krystian1991x   Powiedz że nie wiesz co jest źle a nie gadaj od rz...   15.10.2010, 19:00:50
- - rocktech.pl   Ja wiem co jest źle tylko ty masz problem ze zrozu...   15.10.2010, 23:04:17
- - krystian1991x   uwierz że wystarczyło displays usunąć z podstron   16.10.2010, 12:06:17


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: 3.10.2025 - 07:28