Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 1-10 of 137 result(s).

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

Updated a day ago by Scott_HuangTips1 comment – viewed 678 times – version 2.0
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

Add model validator in Controller

Updated 2 days ago by KonApazTips4 comments – viewed 584 times – ( +1 / -1 ) – version 1.1
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way

Create Form With DynamicModel

Updated 7 days ago by Misbahul D MunirTips2 comments – viewed 1,077 times – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

Yii 2 list of path aliases available with default basic and advanced app.

Updated 11 days ago by Yatin MistryTips0 comments – viewed 4,933 times – ( +30 / -5 ) – version 2.0
If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Updated about a month ago by Kartik VTips5 comments – viewed 6,903 times – ( +28 / -4 ) – version 2.0
With Bootstrap 3 and its inbuilt support in Yii Framework 2.0, you would see quite some new ways of creating HTML markup and styling your site. However, with version 3 of Bootstrap, tooltips and popover are not activated by default on your elements. Assuming you have activated the Bootstrap 3 tooltip plugin - how do you easily enable display of tooltips/popovers across your site?

embedded javascript block in your view with IDE checking or intellisense

Updated about a month ago by yiqing95Tips0 comments – viewed 1,672 times – ( +3 ) – version 2.0
this is my way for embed js code block in view file:

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

Updated 2 months ago by Rohit SutharTips2 comments – viewed 17,187 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

using multiple radio button

Updated 2 months ago by Rohit SutharTips4 comments – viewed 29,952 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().

Expert's model generation with Gii

Updated 3 months ago by le_topTips0 comments – viewed 2,992 times – ( +3 ) – version 1.1
Efficient coding with Yii implies efficient use of the code generator. This article shares the personalised Gii templates that were built starting from the standard templates proposed by AweGen.

Search scenario (CGridView, etc.): avoid default values from database as search condition.

Updated 3 months ago by le_topTips1 comment – viewed 1,835 times – ( +1 ) – version 1.1
Yii has a neat "trick" that will assign default values to new CActiveRecords. When performing a search() though, this is pretty annoying as they automatically apply as filter values.