Wiki

Articles in category "tips"X
Displaying 71-80 of 137 result(s).

Access log output from unit tests

Created 2 years ago by MikeTips2 comments – viewed 5,254 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.

Created 2 years ago by sirin kTips12 comments – viewed 30,692 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

How to catch and log MySQL deadlock errors

Created 2 years ago by sebTips1 comment – viewed 8,566 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

using multiple radio button

Created 2 years ago by francis jaTips4 comments – viewed 29,929 times – ( +6 / -1 ) – version 1.1
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

Created 2 years ago by junxiongTips6 comments – viewed 18,487 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.

Update two models with one view

Created 2 years ago by sensorarioTips11 comments – viewed 31,960 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

Created 2 years ago by sensorarioTips5 comments – viewed 23,574 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 =).

Use application on production/development environment without making changes

Created 2 years ago by ifdatticTips3 comments – viewed 31,256 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.

Managing constants easily

Created 2 years ago by briiC.lvTips4 comments – viewed 10,571 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 counters with ActiveRecord

Created 2 years ago by davi_alexandreTips8 comments – viewed 19,869 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).