Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 91-100 of 146 result(s).

Update two models with one view

Updated 2 years ago by SebKTips11 comments – viewed 33,736 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 24,702 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,612 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 9,143 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 3 years ago by junxiongTips6 comments – viewed 19,731 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.

Use application on production/development environment without making changes

Updated 3 years ago by ifdatticTips3 comments – viewed 33,811 times – ( +8 / -1 ) – version 1.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 3 years ago by marcovtwoutTips3 comments – viewed 11,138 times – ( +14 ) – version 1.1
Many time for SEO porpouses is important that each page will have a unique address.
tags: SEO, unique, URL

Managing constants easily

Updated 3 years ago by briiC.lvTips4 comments – viewed 11,426 times – ( +4 ) – version 1.1
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.

Using events with CAction classes

Updated 3 years ago by 张 迪Tips0 comments – viewed 11,673 times – ( +9 ) – version 1.1
There are some good guides out there explaining how to work with events and the ways to attach them to your components, but none (that I know) explain the following way to configure your events with CAction classes on your controllers the following way.

Yii Security-extended guide

Updated 3 years ago by bingjie2680Tips11 comments – viewed 15,916 times – ( +6 / -6 ) – version 1.1
This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in your application without much caring.