xutongle
- xutongle 赞了说说以前高中老师总说高中紧,大学就松了。现在想想真是一句值得细细品味的话。
- xutongle 赞了说说为什么http://localhost:8080/index.php这样可以访问,但是http://localhost:8080/basic/web/index.php却访问不了,报错The requested URL /basic/web/index.php was not found on this server.
- xutongle 2016-03-18 已签到连续签到1天,获得了5个金钱
- xutongle 赞了回答
把模块配置独立出来,每安装一个模块就往里面配置里面合并数据不就行了。
我的实现方法是在保存成功后,往通知表中写入数据。比如,我在回答完此问题之后,在通知的表中增加一条通知数据。
模型类
Answer.php
的afterSave
代码如下:public function afterSave($insert, $changedAttributes) { parent::afterSave($insert, $changedAttributes); if($insert) { Notice::add('answer', $this->question->user_id, $this->id); } }
我知道这种方式,我是想知道Notice模型的实现方式。
- xutongle 2016-03-05 已签到连续签到1天,获得了5个金钱
- xutongle 2016-03-02 已签到连续签到1天,获得了5个金钱