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.
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.
When someone want to send formatted HTML mails from a console application she/he will probably come across the problem of rendering view files.
This wiki has been replaced by Use crypt() for password storage.
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).
Lets say we have two models and relation between them:
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.
This is a simple demo how to use Zend_AMF with Yii.
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.
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.
How to create a simple (non-RBAC) authorization system
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...First of all, You must change component config to enable the default Yii CSRF validation.
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...
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.
This is an incipient implementation of application-driven database with Yii.
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.
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.
Here are all wiki articles from "Understanding" series by Yii wiki contributors:
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.
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.