2017-05-11 12 views
0

내가 시도하려는 것은 사용자 정의 탭에 템플릿을 표시하는 것입니다. 이것의prestashop - 탭에 멋진 템플릿로드

<p>This is just a test</p> 

결과 :

<?php 
class AdminTController extends ModuleAdminController { 

    public function __construct() { 
     parent::__construct(); 
    } 

    public function display() { 

     //echo $this->l('This is admin my module tab !'); 
     // the echo works. 
     $this->createTemplate('initial.tpl'); 
    } 
} 

이 /views/templates/admin/initial.tpl의 코드입니다 :

는 컨트롤러/관리/AdminTController.php의 코드 코드는 빈 페이지입니다. 이것은 템플릿이로드되지 않았 음을 의미합니다. 내가 도대체 ​​뭘 잘못하고있는 겁니까?

답변

0

아래 코드를 사용해보십시오.

<?php 
class AdminTController extends ModuleAdminController { 

    public function __construct() { 
     parent::__construct(); 
    } 

    public function display() { 
     $tpl = $this->custom_smarty->createTemplate('initial.tpl'); 
     return $tpl->fetch(); 
    } 
} 
?>