Articles in category "tutorials", sorted by commentsX
Displaying 41-50 of 251 result(s).

Behaviors & events

Created 7 years ago by pestaaTutorials10 comments – viewed 123,549 times – ( +52 ) – version 1.1
These features provide endless possibilities and unbelievable flexibility, but as current documentation does not give more than a few examples, it might be difficult to fully understand their internals and requirements.

Display an AJAX tree from your DB using CTreeView

Created 6 years ago by Fran├žois GannazTutorials10 comments – viewed 55,468 times – ( +21 ) – version 1.1
This example uses a MySQL DB with a table named tree with the fields id, name, and parent_id. The parent_id will be NULL for root elements. The SQL is kept simple (no autoinc, no FK, etc).
tags: AJAX, CTreeView

How to automate timestamps in ActiveRecord models

Created 7 years ago by dalipTutorials9 comments – viewed 142,065 times – ( +32 ) – version 1.1
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:

Exporting CGridView results to CSV file

Created 4 years ago by RusAlexTutorials9 comments – viewed 44,291 times – ( +6 / -3 ) – version 1.1
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

Creating a database-driven hierarchical Structure combined with CMenu and superfish

Created 6 years ago by thyseusTutorials9 comments – viewed 47,756 times – ( +15 ) – version 1.1
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
tags: menu

Events explained

Created 4 years ago by pligorTutorials9 comments – viewed 36,243 times – ( +22 / -3 ) – version 1.1
Let's see what exactly are the events in Yii!

Send mail using YiiMail extension

Created 3 years ago by RKATutorials9 comments – viewed 64,523 times – ( +8 ) – version 1.1
Let me show a simpe example to send mail using YiiMail extension in 5 steps. It also includes any template view if required along with the content.
tags: YiiMail

Use shortcut functions to reduce typing

Created 7 years ago by qiangTutorials8 comments – viewed 48,628 times – ( +58 ) – version 1.1
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user; to access application parameters, we need Yii::app()->params['name']; and so on. While editors like textmate can help alleviate the problem of these lengthy typings, it is worthwhile to define global shortcut functions to some commonly used method calls. They will make the application code look cleaner.

Custom Number Formatting or Decimal Separators and i18n

Created 4 years ago by c@cbaTutorials8 comments – viewed 52,022 times – ( +7 ) – version 1.1
By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...

CSqlDataProvider in CGridView

Created 2 years ago by Kostas Apazidis (KonApaz)Tutorials8 comments – viewed 20,718 times – ( +8 ) – version 1.1
In this wiki I will show how could use a CSqlDataProvider in CGridView with specific features