Wiki

Articles in category "tips", sorted by viewsX
Displaying 41-50 of 151 result(s).

Using counters with ActiveRecord

Created 4 years ago by davi_alexandreTips9 comments – viewed 26,858 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).

Step by step for how to full export Yii2 grid to excel

Created about a year ago by Scott_HuangTips3 comments – viewed 25,503 times – version 2.0
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

Custom column in TbGridView with icon by condition, find out icon class glyphicons easy (YiiBooster)

Created 2 years ago by Kostas Apazidis (KonApaz)Tips2 comments – viewed 25,333 times – ( +2 / -1 ) – version 1.1
First of all, You have to find out the class of the desired icon, so visit the http://getbootstrap.com/2.3.2/base-css.html#icons

Real Time Logging

Created 5 years ago by lucifuriousTips3 comments – viewed 24,050 times – ( +14 ) – version 1.1
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.

Troubleshooting Rights Extension

Created 4 years ago by junxiongTips6 comments – viewed 22,429 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.

Avoiding duplicate script download when using Ajax calls to render different Views

Created 4 years ago by Antonio RamirezTips6 comments – viewed 22,161 times – ( +13 / -1 ) – version 1.1
I had to partially render two types of views, depending on user selection. Wanted to display a GRID or a LIST style with an event that AJAX'ed new contents and update a layer with them.
tags: tutorial, AJAX, views

Send asset folder path to a javascript of a widget

Created 4 years ago by sensorarioTips4 comments – viewed 21,416 times – ( +4 ) – version 1.1
When you develop a widget, you could need one image that is in the assets folder, you can use it simply within a css. You can load a css or javascript script doing this:

How to call a default layout for every module and how to work <php echo $content; ?>

Created 2 years ago by Ankit ModiTips0 comments – viewed 20,778 times – ( -2 )
Hi Friends, Hi Friends, Some common question is difficult to how to create the layout on yii and how to work

Using cache in CActiveDataProvider

Created 4 years ago by StammTips7 comments – viewed 19,292 times – ( +21 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.

Debugging CActiveRecord failed save() attempts

Created 3 years ago by BoazTips0 comments – viewed 19,037 times – ( +5 ) – version 1.1
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.