Wiki

Articles in category "tips", sorted by ratingX
Displaying 31-40 of 154 result(s).

Display a nice exception message on ajax requests

Created 5 years ago by Maurizio Domba CerinTips3 comments – viewed 37,972 times – ( +13 ) – version 1.1
When an exception is thrown in our code like
tags: error, exception

Change buttons on our CGridView extending yii

Created 5 years ago by sensorarioTips6 comments – viewed 28,893 times – ( +12 ) – version 1.1
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

Install specific Yii2 vendor extension & dependency without updating other packages.

Created 2 years ago by Kartik VTips0 comments – viewed 15,527 times – ( +40 / -6 ) – version 2.0
The tips here are for advanced usages of composer and its assumed you have read about using composer and have a knowledge of your vendor packages to be updated. Let's consider, you want to update only one specific yii2 vendor library, without updating all the other extension packages?

A simple action for CJuiAutoComplete

Created 6 years ago by tydeas_drTips9 comments – viewed 38,306 times – ( +17 / -1 ) – version 1.1
More or less I use auto-complete field for a form. CJuiAutoComplete is a yii widget for this purposes. The common use case is to make an ajax request and retrieve a list from the database. So in this case you have to write a controller action to return you a json encoded list. What if I had a generic action to do this work for me?

Using CListView to display items next to each other (in columns)

Created 3 years ago by thyseusTips4 comments – viewed 12,845 times – ( +11 )
When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:

Ajax update

Created 6 years ago by zaccariaTips2 comments – viewed 48,086 times – ( +21 / -2 ) – version 1.1
Often happens to have the need of change a part of the page with ajax.
tags: AJAX

Directory independent extensions

Created 6 years ago by GOshaTips3 comments – viewed 11,345 times – ( +16 / -1 ) – version 1.1
Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

An Easy Solution for Dependent dropDownList Using AJAX

Created 4 years ago by mrsTips11 comments – viewed 81,661 times – ( +16 / -1 ) – version 1.1
Sometimes new Yii guys face problem to manage dependent dropDownList using AJAX. I am going to discuss an easy solution about this issue.

Search method of a model for filters when using dates - unixtimestamp in database

Created 6 years ago by MukkeTips1 comment – viewed 28,436 times – ( +10 ) – version 1.1
I ran into a problem and on irc we worked it out. Since there is a lack on information on filters in genral i thought i'd start sharing all my findings, might be usefull for other people.

A simple class to use a different db for a module

Created 5 years ago by tydeas_drTips3 comments – viewed 18,446 times – ( +10 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?