jixinyu

jixinyu

这家伙有点懒,还没写个性签名!

  • 财富值100
  • 威望值0
  • 总积分130

个人信息

  • 赞了回复

    Actions 分两种:Inline Actions 和 Standalone Actions. 前者以 action methods 形式存在,比如 actionIndex(); 后者以类的形式存在,这个类必须继承自 yii\base\Action 或其子类。

    site/error action 是以 Standalone Actions 形式存在的:

    class SiteController extends Controller
    {
    	...
    
        public function actions()
        {
            return [
                'error' => [
                    'class' => 'yii\web\ErrorAction',
                ],
            ];
        }
    
    	...
    }
    

    所以在 SiteController 内没有 actionError method.

    参考 Guide 2.0 中 Application Structure → Controllers → Creating Actions 内容。

  • 赞了回复

    levels 类似,都是起过滤作用的。你可以把 categories 的值改成 ['yii\db\*'], 然后在 Yii Debugger 里查看一下日志信息的变化感受一下。参考 Guide Handling Requests → Logging → Log Targets → Message Filtering

  • 2016-01-20 已签到
    连续签到1天,获得了5个金钱
  • 回复了 的回答

    这个有很多可能,问题最好能够详细些
    比如有可能定义了场景,规则rule,字段是否safe

    问题已经搞定了,是phpstorm打开项目默认编码是gbk,而数据字符集为utf8编码冲突,导致中文无法插入数据库

  • 回复了 的回答

    这个有很多可能,问题最好能够详细些
    比如有可能定义了场景,规则rule,字段是否safe

    没有设置rule
    try {

            $primaryCon = Yii::$app->db;
            $primaryCon->createCommand()->insert('wx_log',
                [
                    'log_type' => $logType,
                    'log_module' => $logModule,
                    'log_method' => $logMethod,
                    'log_data' => $logData,
                    'log_logic' => $logLogic,
                    'create_user' =>$createUser,
                    'create_time' => date('Y-m-d H:i:s', time())
                ]
            )->execute();
        } catch (Exception $e) {
            return;
        }
    
  • 提出了问题
    中文字段无法插入数据库
  • 发布了话题
    配置里 日志categories代表的什么
助理 等级规则
130/200
资料完整度
0/100
用户活跃度
20/100

Ta的关注

0

Ta的粉丝

0

Ta的访客

3