Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 1-10 of 242 result(s).

By Example: CHtml

Created 5 years ago by jonahTutorials15 comments – viewed 675,286 times – ( +115 / -1 ) – version 1.1
"By Example" cookbook pages will provide coding examples for many of the commonly used classes within Yii. We will try to provide as many usage examples as possible for keep these pages as helpful as possible.

How to upload a file using a model

Created 6 years ago by qiangTutorials6 comments – viewed 372,144 times – ( +85 / -6 ) – version 1.1
First declare an attribute to store the file name in the model class (either a form model or an active record model). Also declare a file validation rule for this attribute to ensure a file is uploaded with specific extension name.
tags: File upload

Creating a dependent dropdown

Created 6 years ago by dalipTutorials53 comments – viewed 283,573 times – ( +111 / -3 ) – version 1.1
Often you'll need a form with two dropdowns, and one dropdown's values will be dependent on the value of the other dropdown. Using Yii's built-in AJAX functionality you can create such a dropdown.

Yii for beginners

Created 3 years ago by rackyczTutorials13 comments – viewed 254,187 times – ( +97 ) – version 1.1
Hi. This is first article with my Yii tutorial. I had to split it into more articles as there's limited length of texts on Wiki. So once you understand basics, you can read next article here: Yii for beginners 2.

Update content in AJAX with renderPartial

Created 5 years ago by BurzumTutorials15 comments – viewed 217,954 times – ( +59 ) – version 1.1
The easiest way to update content in AJAX is to use the renderPartial method.
tags: AJAX

How to work with flash messages

Created 6 years ago by pfthTutorials12 comments – viewed 204,302 times – ( +59 ) – version 1.1
Set your messages in a controller:

How to use a single form to collect data for two or more models?

Created 6 years ago by qiangTutorials33 comments – viewed 179,808 times – ( +118 / -1 ) – version 1.1
Assume we want to use a single HTML form to collect input for both model A and model B, and we want to display input errors (if any) in the same error summary box. We can define the following action code:

NetBeans IDE and Yii projects

Created 4 years ago by marcovtwoutTutorials28 comments – viewed 179,602 times – ( +76 ) – version 1.1
This page is created to supply short directions and general tips for managing a Yii application in NetBeans IDE.

Searching and sorting by related model in CGridView

Created 3 years ago by Maciej Li┼╝ewskiTutorials86 comments – viewed 155,944 times – ( +125 ) – version 1.1
Lets say we have two models and relation between them:

Creating a Simple CRUD App With Yii2 (Revised 12/20/2013)

Created 2 years ago by Charles R. Portwood IITutorials7 comments – viewed 141,721 times – ( +9 / -10 ) – version 2.0
Creating a Simple CRUD App with Yii Framework 2 (Updated December 20th, 2013)
tags: yii2, tutorial, howto