博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
[Yii Framework] Error Handler for Modules
阅读量:6885 次
发布时间:2019-06-27

本文共 532 字,大约阅读时间需要 1 分钟。

As we know, in Yii, we can set the error handler to display some useful message to the user.

But, when i want to display different views in different modules, how to do it?

Here is the way.

 

In your module, here let say we have a admin module, there is AdminModule.php in it, 

then add the code as below:

public 
function init()
{
    
//
other codes...
    Yii::app()->setComponents(
array(
        'errorHandler'=>
array(
        'errorAction'=>'admin/default/error',
        ),
    ));
}

after that, we point the error handler to admin/default/error.

 

Have fun with Yii! 

 

转载地址:http://avtbl.baihongyu.com/

你可能感兴趣的文章
solr索引报错(java.lang.OutOfMemoryError:GC overhead limit exceeded)
查看>>
python基础2--小结篇
查看>>
Ajax传统操作
查看>>
webpack01
查看>>
NoSQL 简介
查看>>
功能测试思考点
查看>>
PHP代码审计
查看>>
杭电4786--Fibonacci Tree(生成树)
查看>>
git 基础
查看>>
搜索高亮
查看>>
图片上没有line-height垂直居中
查看>>
图片标记 : 行内元素 单边标记
查看>>
canvas基础—图形变换
查看>>
NOIP2014 T4 子矩阵 dfs+dp
查看>>
OO方式实现ALV: cl_salv_table
查看>>
php 使用 restler 框架构建 restfull api
查看>>
makefile中的变量赋值
查看>>
基于KVM的虚拟化研究及应用
查看>>
Libvirt 虚拟化库剖析
查看>>
计算机英语
查看>>