Wiki

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

Customizing Yii's formatting rules (extending CFormatter)

Created 6 years ago by HaenselTips0 comments – viewed 17,308 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 6 years ago by TrejderTips0 comments – viewed 17,270 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.

Add model validator in Controller

Created 2 years ago by Kostas Apazidis (KonApaz)Tips4 comments – viewed 17,264 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

Adding a link to a CDataColumn

Created 4 years ago by le_topTips6 comments – viewed 17,124 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.

Managing constants easily

Created 5 years ago by briiC.lvTips4 comments – viewed 17,079 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.

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

Created 5 years ago by LuizTips1 comment – viewed 16,889 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.

Auto TDD - How to auto-run PHPUnit

Created 6 years ago by imeheszTips3 comments – viewed 16,271 times – ( +3 / -2 ) – version 1.1
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
tags: PHPUnit, testing, TDD

A simple action for XUpload extension

Created 6 years ago by tydeas_drTips1 comment – viewed 16,037 times – ( +3 / -1 ) – version 1.1
All the basic functionality for an action used by the xupload extension. Check resources for the source code of this action
tags: tips, xupload, caction

Easy way to redirect http:\\localhost\yii2-basic to http:\\localhost\yii2-basic\web\index.php

Created 2 years ago by Scott_HuangTips0 comments – viewed 15,997 times – ( +3 / -4 ) – version 2.0
First of all, install yii2 basic template according below link:

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

Created 3 years ago by Kartik VTips2 comments – viewed 15,964 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.