Articles in category "tips", sorted by ratingX
Displaying 21-30 of 149 result(s).

CGridView: Update/create records in a CJuiDialog

Created 3 years ago by JobloTips12 comments – viewed 43,376 times – ( +14 ) – version 1.1
My article Display the full record in a CJuiDialog uses ajax to view a record in dialog on clicking the 'view-icon'.

Real Time Logging

Created 4 years ago by lucifuriousTips3 comments – viewed 22,322 times – ( +14 ) – version 1.1
I've seen a lot of people asking about the logging facilities in Yii and thought I'd share a nice little class I wrote that provides near real-time logging.

How to ensure unicity to url

Created 4 years ago by zaccariaTips3 comments – viewed 11,846 times – ( +14 ) – version 1.1
Many time for SEO porpouses is important that each page will have a unique address.
tags: SEO, unique, URL

Customizing Yii's formatting rules (extending CFormatter)

Created 4 years ago by HaenselTips0 comments – viewed 14,859 times – ( +14 ) – version 1.1
CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model). When using CDetailView we would usually make use of PHPs implode function to create a simple string value of all values in the $product->tags array.

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Created about a year ago by Kartik VTips5 comments – viewed 21,620 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?

FORM with GET method causes repeated stacking of URL Parameters

Created about a year ago by Kartik VTips2 comments – viewed 10,799 times – ( +39 / -4 ) – version all
You are using an ActiveForm in yii (both v1.x or 2), with a GET method like below:

Special $variables in CGridView and CListView

Created 4 years ago by Steve FriedlTips11 comments – viewed 53,843 times – ( +27 / -2 ) – version 1.1
The popular CListView and CGridView widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

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

Created about a year ago by Kartik VTips1 comment – viewed 31,221 times – ( +43 / -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.

Locking your Yii 2 project package versions with composer.lock

Created about a year ago by Kartik VTips0 comments – viewed 3,109 times – ( +37 / -4 ) – version 2.0
Ok, you have installed a Yii 2 basic or advanced app for the first time and completed the post install steps. You have picked up a few extensions to install for the first time as well. You would already see a composer.lock file in your application root folder.

Getting nulls from database instead of empty strings

Created 4 years ago by samdarkTips2 comments – viewed 10,357 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null