![]() |
![]() |
![]()
Post
#1
|
|
Grupa: Zarejestrowani Postów: 1 168 Pomógł: 126 Dołączył: 5.02.2010 Skąd: Świdnica Ostrzeżenie: (0%) ![]() ![]() |
Witam,
jak w taki szablon wstawić kod php, który np wykona echo'd';: Kod <html> <head> <title>Smarty: pierwszy skrypt</title> </head> <body> <p>Hello world! TPL {$data}!</p> </body> </html> Dodam, że nie działa: Kod {php} echo 'd'; {/php} oraz Kod <{php}> echo 'd'; <{/php}> A błąd, który otrzymuję: Kod Fatal error: Uncaught exception 'SmartyCompilerException' with message 'Syntax Error in template "..\web\templates\index.tpl" on line 7 "{php}{/php}" unknown tag "php"' in F:\WORK\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665
( ! ) SmartyCompilerException: Syntax Error in template "..\web\templates\index.tpl" on line 7 "{php}{/php}" unknown tag "php" in F:\WORK\smarty\sysplugins\smarty_internal_templatecompilerbase.php on line 665 |
|
|
![]() |
![]()
Post
#2
|
|
![]() Grupa: Moderatorzy Postów: 36 557 Pomógł: 6315 Dołączył: 27.12.2004 ![]() |
Zaglądasz do manuala:
http://www.smarty.net/docs/en/language.function.php.tpl i widzisz: Cytat IMPORTANT NOTICE {php} tags are deprecated from Smarty, and should not be used. Put your PHP logic in PHP scripts or plugin functions instead. Note As of Smarty 3.1 the {php} tags are only available from SmartyBC. Wiem, trudno znaleźć.... ![]() Po co w ogóle wkładać tam php? PHP ma być po stronie php, a smarty służy jedynie za wyświetlanie a nie używanie jeszcze php. -------------------- "Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista "Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer |
|
|
![]()
Post
#3
|
|
Grupa: Zarejestrowani Postów: 1 168 Pomógł: 126 Dołączył: 5.02.2010 Skąd: Świdnica Ostrzeżenie: (0%) ![]() ![]() |
No trudno trudno
![]() |
|
|
![]() ![]() |
![]() |
Wersja Lo-Fi | Aktualny czas: 18.07.2025 - 02:05 |