随笔分类 -  Yii

摘要:Yii 有很多 extension 可以使用,在查看了 Yii 官网上提供的与 OAuth 相关的扩展后,发现了几个 OAuth2 的客户端扩展,但是并没有找到可以作为 OAuth2 Server 的扩展。因为 Yii 是组织良好的易于扩展的框架,所以完全可以集成其它的 PHP OAuth2 Ser 阅读全文
posted @ 2018-01-16 09:40 追忆丶年华 阅读(232) 评论(0) 推荐(0) 编辑
摘要:一、一个sql拼装的情况 $criteria = new CDbCriteria; //函数方式 $criteria->addCondition("id=1"); //查询条件,即where id = 1 $criteria->addInCondition('id', array(1,2,3,4,5 阅读全文
posted @ 2018-01-16 09:39 追忆丶年华 阅读(146) 评论(0) 推荐(0) 编辑
摘要:数据模型搜索方法: public function search() { // Warning: Please modify the following code to remove attributes that // should not be searched. $criteria=new C 阅读全文
posted @ 2018-01-16 09:36 追忆丶年华 阅读(463) 评论(0) 推荐(0) 编辑
摘要:$criteria = new CDbCriteria;$criteria->compare('name',$this->name,true,'OR'); //like部分匹配//$criteria->addCondition("id=1"); //查询条件,即where id = 1//$crit 阅读全文
posted @ 2018-01-16 09:32 追忆丶年华 阅读(604) 评论(0) 推荐(0) 编辑
摘要:1. 存取数据库方法存储第一种(SAVE )存表时候用到 例子: $post=new Post;$post->title='sample post';$post->content='content for the sample post';$post->createTime=time();/$pos 阅读全文
posted @ 2018-01-16 09:28 追忆丶年华 阅读(121) 评论(0) 推荐(0) 编辑
摘要:$criteria = new CDbCriteria; //select $criteria->select = '*';//默认* $criteria->select = 'id,name';//指定的字段 $criteria->select = 't.*,t.id,t.name';//连接查询 阅读全文
posted @ 2018-01-16 09:10 追忆丶年华 阅读(249) 评论(0) 推荐(0) 编辑