Wiki articles

Showing 381-400 of 651 items.

Accessing data in a join table with the related models

Created 12 years ago by fsb, updated 12 years ago by krowe.

Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.

16 1
30 followers
Viewed: 147 657 times
Version: 1.1
Category: How-tos

Rendering a view file in a console application

Created 12 years ago by Tompi, updated 12 years ago by Tompi.

When someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.

2 1
7 followers
Viewed: 20 244 times
Version: 1.1
Category: How-tos

Secure password hash storage and a Yii helper extension

Created 12 years ago by fsb, updated 11 years ago by fsb.

This wiki has been replaced by Use crypt() for password storage.

13 0
13 followers
Viewed: 77 164 times
Version: 1.1
Category: Tutorials

Using counters with ActiveRecord

Created 12 years ago by davi_alexandre, updated 9 years ago by marcovtwout.

Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).

11 1
17 followers
Viewed: 45 553 times
Version: 1.1
Category: Tips

Searching and sorting by related model in CGridView

Created 12 years ago by Maciej Liżewski, updated 10 years ago by Kostas Apazidis (KonApaz).

Lets say we have two models and relation between them:

77 0
93 followers
Viewed: 276 843 times
Version: 1.1
Category: Tutorials

1:n relations sometimes require CDbCriteria.together

Created 12 years ago by fsb, updated 10 years ago by fsb.

There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

15 0
12 followers
Viewed: 51 988 times
Version: 1.1
Category: Tips

How to use Flash, Zend AMF and Yii Framework

Created 12 years ago by janisto, updated 12 years ago by janisto.

This is a simple demo how to use Zend_AMF with Yii.

3 0
6 followers
Viewed: 16 164 times
Version: 1.1
Category: Tutorials

CGridView: Render customized/complex datacolumns

Created 12 years ago by Joblo, updated 11 years ago by Joblo.

If you have to display a overview of related data in a table, you can use the CListView, create your view with table/tr/td tags and implement db-queries in the view to display detaildata of the current (master-)record.

53 0
74 followers
Viewed: 168 959 times
Version: 1.1
Category: Tips
Tags: CGridView

Model password confirmation field.

Created 12 years ago by twisted1919, updated 12 years ago by PashaL.

I had some troubles with the password confirmation field for when adding updating user records, so i thought that i should share the way i got it working.

8 0
19 followers
Viewed: 95 093 times
Version: 1.1
Category: How-tos

Simple authorization system

Created 12 years ago by Gustavo, updated 11 years ago by Gustavo.

How to create a simple (non-RBAC) authorization system

14 0
17 followers
Viewed: 45 705 times
Version: 1.1
Category: How-tos

How to write secure Yii1 applications

Created 12 years ago by François Gannaz, updated 3 years ago by François Gannaz.
  • Validate the user input (see below for details).
  • Protect (escape) your application output according to context (see below for a few output types, mostly HTML and SQL).
  • Test your application in debug mode.
    Set the constant YII_DEBUG to true (by default, it is defined in index.php) and put alongside error_reporting(E_ALL);. Then errors and warnings will stop the execution an...
80 0
114 followers
Viewed: 314 928 times
Version: 1.1
Category: How-tos

How to validate CSRF token with session

Created 13 years ago by yangmls, updated 13 years ago by yangmls.

First of all, You must change component config to enable the default Yii CSRF validation.

21 0
27 followers
Viewed: 102 506 times
Version: 1.1
Category: How-tos
Tags: CSRF, session

Yii Security-extended guide

Created 13 years ago by bingjie2680, updated 12 years ago by bingjie2680.

This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in you...

6 6
12 followers
Viewed: 31 717 times
Version: 1.1
Category: Tips

How to re enable logging during unit testing

Created 13 years ago by Asgaroth, updated 13 years ago by Asgaroth.

Some of you have experienced the need to log some information while doing unit testing, due to the fact that the information given in the summary is just not enough, to know why the test is actually failing. this article focuses on 2 ways to get you logs up and running again.

11 0
10 followers
Viewed: 26 067 times
Version: 1.1
Category: How-tos

Application-driven database with CDbMigration and an extended CActiveRecord

Created 13 years ago by Tudor Ilisoi, updated 13 years ago by Tudor Ilisoi.

This is an incipient implementation of application-driven database with Yii.

8 0
10 followers
Viewed: 16 810 times
Version: 1.1
Category: Others

How to insert a Simple Dialog Box

Created 13 years ago by bluyell, updated 13 years ago by bluyell.

I build this simple PHP class (DialogBox.php at the bottom of this wiki) to help you in the dialog box usage on Yii applications. The goal is run any Yii actions into this dialog box and return the resulting value to the calling instance.

5 0
9 followers
Viewed: 40 104 times
Version: 1.1
Category: How-tos

How to learn Yii?!

Created 13 years ago by yJeroen, updated 4 years ago by CeBe.

Here is a step by step To-Do list for Yii beginners. The list is an advice of what tutorials and documentation you can walk through to get a full understanding of the Yii Framework. These can be a help to learn Yii.

17 0
21 followers
Viewed: 120 935 times
Version: all
Category: Tutorials

Understanding series articles

Created 13 years ago by GOsha, updated 13 years ago by GOsha.

Here are all wiki articles from "Understanding" series by Yii wiki contributors:

16 0
12 followers
Viewed: 15 104 times
Version: 1.1
Category: Tips

Understanding Scenarios

Created 13 years ago by Luke Jurgs, updated 11 years ago by Luke Jurgs.

Scenarios are an extremely useful tool for separating validation tasks on any class you use derived from CModel. In this tutorial we will use CActiveRecord.

23 0
39 followers
Viewed: 180 961 times
Version: 1.1
Category: Tutorials

File uploads in CForm (Form builder)

Created 13 years ago by Luke Jurgs, updated 13 years ago by Luke Jurgs.

While there is a reasonable amount of documentation regarding CForm (form builder) and file uploads seperately, there really is not any coverage of both in combination.

9 0
10 followers
Viewed: 52 788 times
Version: 1.1
Category: How-tos