Vas*_*liy 5 php joomla install
我正在为Joomla编写安装脚本!1.7组件.如何修改install()脚本部分,以便在出现故障时,我可以向用户显示格式错误的HTML错误?
目前,我只false从install()例程返回,这导致一个神秘的错误消息:
组件安装:自定义安装例程失败
component.php文件中joomla/installer/adapters/component.php包含以下代码,这使我怀疑我无法更改abort()消息.
if ($this->parent->manifestClass && method_exists($this->parent->manifestClass, 'install'))
{
if ($this->parent->manifestClass->install($this) === false) {
// Install failed, rollback changes
$this->parent->abort(JText::_('JLIB_INSTALLER_ABORT_COMP_INSTALL_CUSTOM_INSTALL_FAILURE'));
return false;
}
}
Run Code Online (Sandbox Code Playgroud)
解
在返回错误之前,我可以引发错误,该错误在黄色框中很好地显示.
JError::raiseNotice(1, "Error Message <html code>");
return false;
Run Code Online (Sandbox Code Playgroud)
解决方案
在返回错误之前,我可以提出一个错误,该错误很好地显示在黄色框中。
JError::raiseNotice(1, "Error Message <html code>");
return false;
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
532 次 |
| 最近记录: |