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

CGridView: Display the full record (actionView) in a CJuiDialog

Created 5 years ago by JobloTips7 comments – viewed 41,982 times – ( +15 ) – version 1.1
If you show a model (with a lot of attributes) partially in a CGridView, it can be helpful when the user can take a quick look at the full record with all attributes without displaying the view as a page and afterwards returning back to the gridview.

Styling Radio Buttons

Created 5 years ago by Steve FriedlTips5 comments – viewed 49,870 times – ( +15 ) – version 1.1
The default behavior with radio button lists is ugly, and I figured out mostly how to style them a coupla different ways. I'll used the blog tutorial example (but with my own posting modes):

CGridView: Update/create records in a CJuiDialog

Created 5 years ago by JobloTips12 comments – viewed 46,749 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 5 years ago by lucifuriousTips3 comments – viewed 24,781 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 5 years ago by zaccariaTips3 comments – viewed 13,066 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 5 years ago by HaenselTips0 comments – viewed 16,255 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 2 years ago by Kartik VTips6 comments – viewed 32,924 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?

Special $variables in CGridView and CListView

Created 5 years ago by Steve FriedlTips11 comments – viewed 60,897 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.

Locking your Yii 2 project package versions with composer.lock

Created 2 years ago by Kartik VTips0 comments – viewed 4,812 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 5 years ago by samdarkTips2 comments – viewed 11,457 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