Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 41-50 of 98 result(s).

Update two models with one view

Updated about a year ago by SebKTips10 comments – viewed 18,578 times – ( +10 / -2 )
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 about a year ago by sensorarioTips4 comments – viewed 13,589 times – ( +9 )
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

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

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

How to catch and log MySQL deadlock errors

Updated about a year ago by sebTips0 comments – viewed 5,565 times – ( +4 )
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

using multiple radio button

Updated about a year ago by Maurizio DombaTips2 comments – viewed 14,392 times – ( +5 )
When we use multiple radio buttons with same name in Yii many people have the problem on getting the value of the selected radiobutton. The radioButtonList can be used for that, but if we need to use radioButton itself to place the button any where in a view, we need to include one more parameter in htmloption array().

Troubleshooting Rights Extension

Updated about a year ago by junxiongTips4 comments – viewed 10,402 times – ( +4 )
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.

Use application on production/development environment without making changes

Updated about a year ago by ifdatticTips2 comments – viewed 16,053 times – ( +8 / -1 )
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

How to ensure unicity to url

Updated about a year ago by marcovtwoutTips3 comments – viewed 8,186 times – ( +14 )
Many time for SEO porpouses is important that each page will have a unique address.
tags: SEO, unique, URL

Managing constants easily

Updated about a year ago by briiC.lvTips4 comments – viewed 6,139 times – ( +4 )
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

1:n relations sometimes require CDbCriteria.together

Updated about a year ago by fsbTips4 comments – viewed 13,794 times – ( +13 )
There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.