Wiki

Articles in category "how-tos", sorted by ratingX
Displaying 1-10 of 306 result(s).

Reference: Model rules validation

Created 4 years ago by krillzipHow-tos7 comments – viewed 489,652 times – ( +119 ) – version 1.1
This is a reference to be used for Model rule validation and is compiled from the Yii documentation and code. The purpose is to have all the information gathered in one place instead of scattered. This reference is not an intro. See The Definitive Guide to Yii, Declaring Validation Rules for a tutorial.

How to write secure Yii applications

Created 2 years ago by Fran├žois GannazHow-tos19 comments – viewed 145,847 times – ( +100 ) – version 1.1
warning: While this security guide tries to be quite complete, is not exhaustive. If security matters for you, you ought to check several other references.

Using CButtonColumn to customize buttons in CGridView

Created 3 years ago by TrejderHow-tos17 comments – viewed 188,007 times – ( +96 ) – version 1.1
CGridView is a one of most flexible widgets in Yii and example its flexibility is CButtonColumn used to build buttons for steering model in each grid row. Here in this how-to we will explain ways user can customize CButtonColumn to flexibly fit it to its needs.

How-To: Create a REST API

Created 3 years ago by jwernerHow-tos52 comments – viewed 212,142 times – ( +107 / -1 ) – version 1.1
This article will explain how to create a REST API with the Yii framework.

How to generate Yii-like Documentation

Created 3 years ago by AsgarothHow-tos9 comments – viewed 24,337 times – ( +45 ) – version 1.1
Something a good application cant miss is documentation, and what would be better than some nice formatted HTML documentation that can be auto-generated from your code, we know several tools that already do this like phpDocumentor, but today we are introducing Yii Docs Generator which is a modification of the code that Yii itself uses to generate its documentation, thank phpnode for this wonderful work.
tags: doc

How to use nested DB transactions (MySQL 5+, PostgreSQL)

Created 5 years ago by mindehHow-tos5 comments – viewed 23,826 times – ( +42 ) – version 1.1
Original source code and idea are from: PHP, PDO & Nested Transactions.

Javascript and AJAX with Yii

Created about a year ago by Fran├žois GannazHow-tos2 comments – viewed 91,298 times – ( +40 ) – version 1.1
This page intends to provide an exhaustive guide of how to use Javascript (JS) in Yii. It does not explain how to learn coding in JS, but how to deal with it "the Yii way".
tags: javascript, AJAX

Single table inheritance

Created 3 years ago by samdarkHow-tos6 comments – viewed 22,710 times – ( +38 ) – version 1.1
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field of the same table.

Uploading multiple images with CMultiFileUpload

Created 3 years ago by rsinghHow-tos16 comments – viewed 73,866 times – ( +37 ) – version 1.1
"The documentation for CMultiFileUpload isn't clear!"

Actions code reuse with CAction

Created 3 years ago by Antonio RamirezHow-tos13 comments – viewed 29,269 times – ( +35 ) – version 1.1
We all know how good 'gii' automates the code for us and we normally tend to be happy with what that tool offers at the beginning of our Yii learning curve. But as soon as you start working in larger and larger projects, you realize that its code is too repetitive to maintain and having a small pitfall in general actions means to go over and over through them to fix the issues.
tags: CAction, Tutorial