Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 21-30 of 148 result(s).

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

Updated 6 months ago by Scott_HuangTips0 comments – viewed 4,369 times – ( +2 / -3 ) – version 2.0
First of all, install yii2 basic template according below link:

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

Updated 6 months ago by Scott_HuangTips2 comments – viewed 7,788 times – version 2.0
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

Add model validator in Controller

Updated 6 months ago by Kostas Apazidis (KonApaz)Tips4 comments – viewed 4,884 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 6 months ago by Misbahul D MunirTips4 comments – viewed 3,466 times – version 2.0
In yii2 we can create form without create FormModel. Here we go
tags: form, yii2, model

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Updated 7 months ago by Kartik VTips5 comments – viewed 15,874 times – ( +38 / -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 7 months ago by yiqing95Tips0 comments – viewed 2,537 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 9 months ago by Rohit SutharTips2 comments – viewed 20,175 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 9 months ago by Rohit SutharTips4 comments – viewed 35,076 times – ( +9 / -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 9 months ago by le_topTips0 comments – viewed 4,704 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 9 months ago by le_topTips1 comment – viewed 2,819 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.