2016-06-20 47 views
1

我正在編寫Prestashop模塊,並且正在嘗試創建配置頁面。getContent()未在Prestashop模塊中顯示配置鏈接

繼文檔和讀取另一個模塊中,我試圖結束這段代碼進行測試:

<?php 
public function getContent() { 
    return '<h1>Config</h1>'; 
} 

如果我安裝的模塊,的Prestashop重定向我到一個頁面像這樣

Config page working

這是正確的。但是在管理員Prestashop中不會生成配置鏈接。

configuration link not showing

的問題是:什麼,我需要做的挫折感表明鏈接?

回答

1

在​​3210文件的模塊有一個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; 
     // ... 
    } 
} 
+1

呀!看看XML,我覺得他們是構造函數的相同對象成員,並嘗試了'$ this-> is_configurable = true'行。根據您的回答編輯分享我的方法。謝謝 :) –