我已经为 expressionengine 制作了一个模块,但我不知道应该如何测试它是否有错误,所以我尝试安装它。但是它没有安装也没有返回任何错误,只是刷新了页面。有人知道怎么做吗?
我的文件是这样的:
第三方 > 上传图片:
- 语言 > 英语 > upload_pictures_lang.php
- View > index.php
- mcp.upload_pictures.php
- mod.upload_pictures.php
- tab.upload_pictures.php
- upd.upload_pictures.php
和安装程序代码
class Upload_pictures_upd
{
var $version='1.0';
function Upload_pictures_upd()
{
$this->EE=& get_instance();
}
function install()
{
$this->EE->load->dbforge();
$data=array(
'module_name' =>'Picture uploader',
'module_version' =>$this->version,
'has_cp_backend' =>'y',
'has_publish_fields'=>'y'
);
$this->EE->db->insert('modules',$data);
$data=array(
'class' =>'upload_pictures',
'method'=>'run'
);
$this->EE->db->insert('actions',$data);
$this->EE->load->library('layout');
$this->EE->layout->add_layout_tabs($this->tabs(),'module_name');
return true;
}
function update($current='')
{
if ($current==$this->version)
{
return false;
}
elseif ($current<2.0)
{
//nothin
}
return true;
}
function uninstall()
{
$this->EE->load->library("layout");
$this->EE->layout->delete_layout_tabs($this->tabs(),'upload_pictures');
return true;
}
function tabs()
{
$tabs['upload pictures']=array(
'upload_pictures_ids'=>array(
'visible' =>'true',
'collapse' =>'false',
'htmlbuttons' =>'false',
'width' =>'100%'
)
);
return $tabs;
}
}
最佳答案
你有关注ExpressionEngine Module Development Tutorial吗?在开发者文档中?
如果您无法安装您的模块,您可能缺少一个或多个必需的功能或文件。文件的命名和位置也非常重要。
如果您怀疑有错误,请启用输出分析器或模板调试器(见下文)并检查 Apache 或 PHP 的 error_log
。
ExpressionEngine's Control Panel Output and Debugging Preferences :
CP Home > Admin > 系统管理 > 输出和调试
关于php - 您将如何测试表达式引擎中的模块是否有错误?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6525174/