Wiki

Articles in category "tips", sorted by viewsX
Displaying 51-60 of 146 result(s).

Extending CActiveForm for some form display fixes and language tweaks

Created 4 years ago by TrejderTips0 comments – viewed 13,992 times – ( +5 ) – 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.

Customizing Yii's formatting rules (extending CFormatter)

Created 3 years ago by HaenselTips0 comments – viewed 13,848 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.

A simple class to use a different db for a module

Created 3 years ago by tydeas_drTips2 comments – viewed 13,667 times – ( +9 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

A simple action for XUpload extension

Created 3 years ago by tydeas_drTips1 comment – viewed 13,606 times – ( +3 ) – 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

Auto TDD - How to auto-run PHPUnit

Created 4 years ago by imeheszTips3 comments – viewed 13,306 times – ( +3 / -1 ) – 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

Activating Bootstrap 3 Tooltips & Popover for your Yii Site.

Created 9 months ago by Kartik VTips5 comments – viewed 13,034 times – ( +32 / -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?

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

Created 2 years ago by LuizTips1 comment – viewed 13,006 times – ( +7 ) – version 1.1
A little hint of how to create a progress bar inside the column of the grid, using the 'bootstrap' extension.

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

Created 9 months ago by Kartik VTips1 comment – viewed 12,591 times – ( +36 / -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.

adding class and links to Ctreeview node

Created 3 years ago by bingjie2680Tips2 comments – viewed 12,454 times – ( +4 ) – version 1.1
This article will show you how to add links and class to each node in ctreeview. so you can attach events in js by obtaining handler on anchor or class.
tags: ctreeview, link, class

Debugging CActiveRecord failed save() attempts

Created about a year ago by BoazTips0 comments – viewed 12,359 times – ( +5 ) – version 1.1
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.