Wiki

Articles in category "tips", sorted by viewsX
Displaying 31-40 of 153 result(s).

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Created 2 years ago by Kartik VTips6 comments – viewed 31,403 times – ( +39 / -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?

How to use a component before every action of a controller

Created 3 years ago by transistorTips1 comment – viewed 30,696 times – ( +3 / -1 ) – version 1.1
I guess this is a tip on how to execute some code before every action in a controller, because I will tell you how I did it and maybe you can use the idea in your project.

Customize CGridView columns directly in your view

Created 4 years ago by clapasTips4 comments – viewed 30,111 times – ( +3 / -2 ) – version 1.1
You usually take a model instance passed into your view to provide data to a CGridView in this way:

Quick Tip about Pagination Params

Created 5 years ago by Antonio RamirezTips2 comments – viewed 28,435 times – ( +6 ) – version 1.1
Developing custom Grids and ListViews for my new CMS I was facing a small challenge: If I was to update/delete/batch delete items of my Grid, how would I return to the current page view?
tags: Pagination

Extending common classes to allow better customization

Created 5 years ago by Steve FriedlTips0 comments – viewed 28,182 times – ( +44 ) – version 1.1
The two most commonly-used base classes in most Yii applications are CController and CActiveRecord, each extended to your own particular models and controllers.

Adding a date range search for CGridView the easy way

Created 3 years ago by mikewalenTips6 comments – viewed 28,003 times – ( +12 ) – version 1.1
After a lot of research, everything I found on adding date range searching to a CGridView advanced search form seemed to involve adding two new public variables (e.g. $date_from, $date_to), 'safe' rules for the new variables, and a rather chunky if/elseif/else check in the search() method. This probably isn't a hassle for most, but because many of the tables in my database contain two or three and sometimes four date columns (e.g. date_created, date_modified, date_deleted etc.), it meant I was having to add up to eight public variables, the corresponding safe rules, and modifying the search() criteria for each date attribute. So, I set about creating a better way and I thought I'd share my work with the community.

Change buttons on our CGridView extending yii

Created 4 years ago by sensorarioTips6 comments – viewed 27,873 times – ( +12 ) – version 1.1
In this tip, I'll help you to change in few second buttons of your CGridView. I hope you like it =).

Yii实战中8个必备常用的扩展,模块和

Created 5 years ago by Darwin WenTips2 comments – viewed 27,687 times – ( +2 / -3 ) – version 1.1
在经过畅K网的实战后,总结一下在Yii的项目中会经常用到的组件和一些基本的使用方法,分享给大家,同时也给自己留个备忘录,下面我以代码加图片说明.
tags: module, Widgets

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

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

Using counters with ActiveRecord

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