Wiki

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

SVG/PNG CHtml:image replacement to provide SVG when the browser supports it.

Updated 35 minutes ago by le_topTips0 comments – viewed 289 times – ( +1 ) – version 1.1
Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.

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

Updated a day ago by Scott_HuangTips0 comments – viewed 557 times – 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 8 days ago by Scott_HuangTips2 comments – viewed 1,202 times – version 2.0
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:

Add model validator in Controller

Updated 9 days ago by KonApazTips4 comments – viewed 1,062 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 14 days ago by Misbahul D MunirTips2 comments – viewed 1,319 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 18 days ago by Yatin MistryTips0 comments – viewed 5,268 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 7,316 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,713 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,336 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 3 months ago by Rohit SutharTips4 comments – viewed 30,127 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().