getContent() 未在 Prestashop 模块中显示配置 link
getContent() not showing config link in Prestashop module
我目前正在编写一个 Prestashop 模块,我正在尝试创建一个配置页面。
按照文档并阅读其他模块,我已经结束了对这个片段的测试:
<?php
public function getContent() {
return '<h1>Config</h1>';
}
如果我安装该模块,Prestashop 会将我重定向到这样的页面
这是正确的。但是在管理中 Prestashop 不会生成配置 link.
问题是:我到底需要做什么才能证明 link?
在模块的 config.xml
文件中有一个 is_configurable
选项:
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blocktopmenu</name>
<displayName><![CDATA[Top horizontal menu]]></displayName>
<version><![CDATA[2.2.3]]></version>
<description><![CDATA[Adds a new horizontal menu to the top of your e-commerce website.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
它也可以从模块构造函数中配置:
<?php
class MyModule extends Module {
public function __construct() {
// ...
$this->is_configurable = true;
// ...
}
}
我目前正在编写一个 Prestashop 模块,我正在尝试创建一个配置页面。
按照文档并阅读其他模块,我已经结束了对这个片段的测试:
<?php
public function getContent() {
return '<h1>Config</h1>';
}
如果我安装该模块,Prestashop 会将我重定向到这样的页面
这是正确的。但是在管理中 Prestashop 不会生成配置 link.
问题是:我到底需要做什么才能证明 link?
在模块的 config.xml
文件中有一个 is_configurable
选项:
<?xml version="1.0" encoding="UTF-8" ?>
<module>
<name>blocktopmenu</name>
<displayName><![CDATA[Top horizontal menu]]></displayName>
<version><![CDATA[2.2.3]]></version>
<description><![CDATA[Adds a new horizontal menu to the top of your e-commerce website.]]></description>
<author><![CDATA[PrestaShop]]></author>
<tab><![CDATA[front_office_features]]></tab>
<is_configurable>1</is_configurable>
<need_instance>1</need_instance>
<limited_countries></limited_countries>
</module>
它也可以从模块构造函数中配置:
<?php
class MyModule extends Module {
public function __construct() {
// ...
$this->is_configurable = true;
// ...
}
}