Prestashop:为我的模块创建一个自定义页面 [英] Prestashop: Creating a custom page for my module
问题描述
我正在寻找可以创建自定义页面的代码.该代码必须包含所有钩子,我应该调整"home"钩子并将我的内容放在那里...
I looking for code which can create a custom page. The code must include all hooks and I should moderate the "home" hook and put my content there...
任何东西都是有用的-示例代码,例如教程,文档或其他内容.
Anything is helpful - sample code for example, tutorials, documentations or something.
最诚挚的问候,
乔治!
推荐答案
(用于PS1.5和PS1.6的)标准方法是设置控制器
The standard way (for PS1.5 & PS1.6) is to make a controller
(不推荐)的另一种方法是制作这样的文件,其中包括页眉/内容/页脚
Another way (not recommended) is to make a file like this wher you include the header/your content/the footer
<?php
global $smarty;
include( '../../config/config.inc.php' );
include( '../../header.php' );
$smarty->display( dirname(__FILE__) . '/mymodule_page.tpl' );
include( '../../footer.php' );
?>
您需要做的是将此文件保存在模块文件夹中,例如newcustompage.php
然后在您的.tpl指向它的地方做一些链接
例如:
what you need to do is save this file in you module folder like newcustompage.php
and then make some link in your .tpl point to it
example:
<a href="{$modules_dir}yourmodulefolder/newcustompage.php">Click this!</a>
这篇关于Prestashop:为我的模块创建一个自定义页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!