Wiki

Articles in category "tips", sorted by viewsX
Displaying 81-90 of 142 result(s).

An important tip when you are using CArrayDataProvider.

Created 2 years ago by sirin kTips0 comments – viewed 8,317 times – ( +8 / -1 ) – version 1.1
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.

Using sub query for doubletts

Created 2 years ago by mbTips3 comments – viewed 8,227 times – ( +1 ) – version 1.1
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

Understanding series articles

Created 3 years ago by GOshaTips0 comments – viewed 8,177 times – ( +16 ) – version 1.1
Here are all wiki articles from "Understanding" series by Yii wiki contributors:

Functional tests independing from your urlManager settings

Created 3 years ago by RusAlexTips1 comment – viewed 7,740 times – version 1.1
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:

mysql performance tip

Created 2 years ago by sirin kTips6 comments – viewed 7,683 times – ( +2 / -1 ) – version 1.1
When we are doing an insert of huge no.of rows into an SQL table ,Normally we will try to write separate insert quries this may lead us to a long duration of execution time and we can increase the speed of executing SQL quries by adding all the rows into a single insert query.
tags: mysql

New Relic Error Alert with Yii

Created about a year ago by simon604Tips2 comments – viewed 7,440 times – ( +5 )
Introduction

how to use github (un)official extension repo in your Yii project

Created 3 years ago by RusAlexTips4 comments – viewed 7,353 times – ( +4 ) – version 1.1
Using a git submodule command in your yii project

Yii CDBHttpSession数据库存储session性能优化实战

Created 3 years ago by Darwin WenTips0 comments – viewed 7,117 times – ( +1 / -1 ) – version 1.1
上一篇 关于 Yii CHttpSession性能优化篇之源码流程分析 有详细分析CHttpSession执行流程,在了解CHttpSession的详细执行流程之后,我们就可以非常轻松的扩展Yii Session,来优化和符合自己的业务流程。

CGridView: Adding behaviors from configuration, and template items from behaviors to CGridView

Created about a year ago by le_topTips0 comments – viewed 6,982 times – ( +5 ) – version 1.1
Changing the way a CGridView is rendered from the configuration file, or through behaviors specified at the moment it is used, is handy to extend a CGridView without creating tons of different classes for it. I am surprised that this is not in the default implementation, so I made my default CGridView implementation.

BaseModuleAR class with MultiActiveRecord

Created 3 years ago by dinhtrungTips0 comments – viewed 6,945 times – ( +2 ) – version 1.1
MultiActiveRecord is an extension that add support for multiple database connection for your application.