Wiki

Articles in category "tips", sorted by date (updated)X
Displaying 11-20 of 141 result(s).

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Updated 3 months ago by Kartik VTips5 comments – viewed 10,112 times – ( +29 / -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 3 months ago by yiqing95Tips0 comments – viewed 1,981 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 4 months ago by Rohit SutharTips2 comments – viewed 18,362 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 4 months ago by Rohit SutharTips4 comments – viewed 31,657 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 5 months ago by le_topTips0 comments – viewed 3,555 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 5 months ago by le_topTips1 comment – viewed 2,225 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.

View a related field in CGridView

Updated 6 months ago by rafaelt88Tips1 comment – viewed 3,159 times – ( +6 ) – version 1.1
Generally we need to show one or more fields from a model that is related to another model used in CGridView. For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".

Key web server settings after installing a fresh Yii 2 basic or advanced app

Updated 7 months ago by Kartik VTips2 comments – viewed 4,355 times – ( +33 ) – version 2.0
So, you have installed a brand new Yii 2 app (basic) or (advanced). Here are a few tips for Apache web server users to get things running more secure and better with your yii2 app.

Model validation for field ranges using yii2-field-range extension

Updated 7 months ago by Kartik VTips0 comments – viewed 3,033 times – ( +29 ) – version 2.0
The yii2-field-range extension enables you to easily setup ActiveField range fields with Bootstrap styling. You basically can setup two attributes joined together like a single field with combined validation error block.

Make an ajax request to another server using JSONP

Updated 7 months ago by KonApazTips0 comments – viewed 3,259 times – ( +1 ) – version 1.1
There are cases that you want to make an ajax request to another server and get the results.