dongyuan9292
2019-03-14 10:25
浏览 62
已采纳

prestashop模块控制器中的“找不到页面”

I'm developing my module and in localhost I have created tab in back office and when I click on this tab controller works fine , But when I upload this module on my real host module can create tab with no problem but when I click on this tab prestashop will show "Page not found !"

this is my code

        $name="My test name";
    $tab = new Tab();
    $tab->id_parent=(int)Tab::getIdFromClassName('AdminParentModulesSf');
    $tab->name=array();
    foreach (Language::getLanguages(true) as $lang){
        $tab->name[$lang['id_lang']]=$name;
    }
    $tab->class_name='AdminMyTest';
    $tab->module=$this->name;
    $tab->active=1;
    $tab->add();

and I have created admin/controllers/AdminMyTest.php

class AdminMyTestController extends ModuleAdminController
{
}

So , have you any idea whats wrong ? Prestashop version is 1.7.4

thanks

图片转代码服务由CSDN问答提供 功能建议

我正在开发我的模块,在localhost中我在后台创建了标签,当我点击这个标签控制器时 工作正常,但是当我在我的真实主机模块上传这个模块时可以创建标签没有问题但是当我点击这个标签时,prestashop会显示“找不到页面!”</ p>

这是我的 代码</ p>

  $ name =“我的测试名称”; 
 $ tab = new Tab(); 
 $ tab-&gt; id_parent =(int)Tab :: getIdFromClassName  ('AdminParentModulesSf'); 
 $ tab-&gt; name = array(); 
 foreach(Language :: getLanguages(true)as $ lang){
 $ tab-&gt; name [$ lang ['id_lang'  ]] = $ name; 
} 
 $ tab-&gt; class_name ='AdminMyTest'; 
 $ tab-&gt; module = $ this-&gt; name; 
 $ tab-&gt; active = 1; \  n $ tab-&gt; add(); 
 </ code> </ pre> 
 
 

我创建了admin / controllers / AdminMyTest.php </ p>

 <  code> class AdminMyTestController扩展了ModuleAdminController 
 {
} 
 </ code> </ pre> 
 
 

所以,你知道什么是错的吗? Prestashop版本是1.7.4 </ p>

谢谢</ p> </ div>

1条回答 默认 最新

相关推荐 更多相似问题