您将如何测试表达式引擎中的模块是否有错误?
我已经为表达式引擎制作了一个模块,但我不知道应该如何测试它的错误,所以我尝试安装它。但它没有安装,也没有返回任何错误,只是刷新了页面。有人知道怎么做吗?
我拥有的文件如下:
third_party > upload_pictures:
- 语言>英语> upload_pictures_lang.php
- 浏览次数 > 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;
}
}
I've made a module for expressionengine, yet I have no idea how I'm supposed to test it for errors, so I tried installing it. But it didn't install and didn't return any errors, just refreshed the page. Anybody know how?
The files I have are like so :
third_party > upload_pictures :
- language > english > upload_pictures_lang.php
- views > index.php
- mcp.upload_pictures.php
- mod.upload_pictures.php
- tab.upload_pictures.php
- upd.upload_pictures.php
and the installer code
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;
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否遵循了开发人员文档中的 ExpressionEngine 模块开发教程?
如果您无法安装模块,则可能缺少一项或多项所需的功能或文件。文件的命名和位置也非常重要。
如果您怀疑有错误,请启用输出分析器或模板调试器(见下文)并检查 Apache 或 PHP 的
error_log
。ExpressionEngine 的控制面板输出和调试首选项:
CP首页>管理员>系统管理>输出和调试
Have you followed the ExpressionEngine Module Development Tutorial in the Developer Documentation?
If you're unable to install your Module, you may be missing one or more of the required functions or files. The naming and location of your files are extremely important, too.
If you suspect errors, enable the Output Profiler or Template Debugger (see below) and check Apache's or PHP's
error_log
.ExpressionEngine's Control Panel Output and Debugging Preferences:
CP Home > Admin > System Administration > Output and Debugging