2014-11-25 2 views
0

"/ themes/my_template/modules/my_modul"폴더의 prestashop (smarty)에 tpl의 PHP 파일을 포함시키고 싶습니다.Prestashop and smarty PHP 코드

예 :

<?php 
include('/tools/smarty/Smarty.class.php'); 
$smarty = new Smarty; 

$vorname="Horst"; 
$nachname="Meyer"; 

$smarty->assign('vorname',$vorname); 
$smarty->assign('nachname',$nachname); 

// ausgabe 
$smarty->display('my_template.tpl'); 
?> 

하지만 변수 {$의 vorname}이 표시되지 않습니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

답변

0

확실하지 않으므로 길을 찾아보세요.

템플릿 디렉토리 내부에서 작업 중이므로 * .tpl 파일을 만들어야합니다. 당신이 PHP 파일을 포함 할 경우 템플릿 내부 변수를 표시하려면, 당신은 http://www.smarty.net/docs/en/language.function.assign.tpl

을 사용할 수 있습니다 http://www.smarty.net/docs/en/language.function.include.php.tpl

, 당신은 템플릿 내부 지침을 include_php 사용할 수 있습니다