Wiki

Articles in category "tips", sorted by viewsX
Displaying 61-70 of 154 result(s).

Code style

Created 7 years ago by zaccariaTips2 comments – viewed 18,660 times – ( +30 / -1 ) – version 1.1
Often, when writing widgets or editing Yii code, it is unclear whether or not the code is following the MVC pattern.
tags: mvc

Using jQuery UI 1.8.10 themes with Yii 1.1.6

Created 7 years ago by a110yTips7 comments – viewed 18,400 times – ( +2 / -1 ) – version 1.1
When using the latest stable jQuery UI themes (1.8.10) with Yii 1.1.6 (which uses 1.8.6) the widgets don't appear (they're invisible but they're there). In order to make them visible you need to change the following line:

Add model validator in Controller

Created 3 years ago by Kostas Apazidis (KonApaz)Tips4 comments – viewed 18,388 times – ( +1 / -2 ) – 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

Managing constants easily

Created 6 years ago by briiC.lvTips4 comments – viewed 18,326 times – ( +4 / -1 ) – version 1.1
For time to time i have models with constants (basicly status constants) which i use in diferent places and if these constant changes, i have to change mentions of constant in code elsewhere.

Adding a link to a CDataColumn

Created 4 years ago by le_topTips6 comments – viewed 18,020 times – ( +3 / -1 ) – version 1.1
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

Customizing Yii's formatting rules (extending CFormatter)

Created 6 years ago by HaenselTips0 comments – viewed 17,826 times – ( +14 / -1 ) – 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.

Extending CActiveForm for some form display fixes and language tweaks

Created 7 years ago by TrejderTips0 comments – viewed 17,719 times – ( +5 / -1 ) – version 1.1
In this simple example I'll demonstrate how to extend CActiveForm class to overload some drawing functions to achieve some commonly used fixes in forms.

BootProgressColumn - Progress Bar Inside GridView Column compatible with 'bootstrap' extension

Created 5 years ago by LuizTips1 comment – viewed 17,521 times – ( +7 / -1 ) – version 1.1
A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

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

Created 3 years ago by Kartik VTips2 comments – viewed 16,977 times – ( +48 / -1 ) – 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.

Debuging variables in Yii2

Created 3 years ago by johonunuTips3 comments – viewed 16,723 times – ( +2 / -2 ) – version 2.0
This tutorial is explained following "basic" application structure.