jixinyu
- jixinyu 赞了回复
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 内容。
- jixinyu 赞了回复
和
levels
类似,都是起过滤作用的。你可以把categories
的值改成['yii\db\*']
, 然后在 Yii Debugger 里查看一下日志信息的变化感受一下。参考 Guide Handling Requests → Logging → Log Targets → Message Filtering 。 - jixinyu 2016-01-20 已签到连续签到1天,获得了5个金钱
这个有很多可能,问题最好能够详细些
比如有可能定义了场景,规则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; }
- jixinyu 提出了问题中文字段无法插入数据库