Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 81-90 of 141 result(s).

Using counters with ActiveRecord

Updated 2 years ago by Alexander UstimenkoTips8 comments – viewed 20,328 times – ( +14 / -1 ) – version 1.1
Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).

CGridView: Display the full record (actionView) in a CJuiDialog

Updated 2 years ago by JobloTips7 comments – viewed 35,727 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.

CGridView: Update/create records in a CJuiDialog

Updated 2 years ago by JobloTips11 comments – viewed 38,515 times – ( +14 ) – version 1.1
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.

Access log output from unit tests

Updated 2 years ago by MikeTips2 comments – viewed 5,342 times – ( +4 ) – version 1.1
Say, you want to write a test for a component which provides a caching feature. How would you know, that some method of your component returns a cached result? With the solution described here you can inspect all log outputs. So you could search the logs for accesses to the DB to really make sure, that the result was served from cache.

Importing CSV file to mysql table using "LOAD DATA" command.

Updated 2 years ago by sirin kTips12 comments – viewed 31,434 times – ( +7 ) – version 1.1
hi, Here i am giving you some simple step to import huge data from a csv file to your mysql table.this is useful when you have a very huge data to import from csv format.
tags: csv, mysql, import

Update two models with one view

Updated 2 years ago by SebKTips11 comments – viewed 32,324 times – ( +10 / -2 ) – version 1.1
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form

Change buttons on our CGridView extending yii

Updated 2 years ago by sensorarioTips5 comments – viewed 23,843 times – ( +11 ) – version 1.1
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

关于Yii CHttpSession性能优化篇之源码流程分析

Updated 2 years ago by Maurizio Domba CerinTips0 comments – viewed 6,042 times – ( +1 / -1 ) – version 1.1
当我们使用Yii数据库去保存Session时,只要简单的配置就可以完成这个功能,在进行性能优化这个主题之前,我们先来查看一下CHttpSession和CDBHttpSession源代码,探讨CHttpSession和CDBHttpSession的流程再进行深一步优化主题。

How to catch and log MySQL deadlock errors

Updated 2 years ago by sebTips1 comment – viewed 8,706 times – ( +4 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Troubleshooting Rights Extension

Updated 2 years ago by junxiongTips6 comments – viewed 18,830 times – ( +8 ) – version 1.1
Rights is one of user interface for Yii's Role Base Access Control extension. It is one of most downloaded extensions in Yii's Web.