Wiki

Articles in category "tutorials", sorted by commentsX
Displaying 21-30 of 172 result(s).

Yii for beginners

Created about a year ago by rackyczTutorials11 comments – viewed 106,187 times – ( +74 )
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.

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

Created 4 years ago by qiangTutorials10 comments – viewed 77,921 times – ( +87 )
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:

Organize directories for applications with front-end and back-end

Created 4 years ago by qiangTutorials10 comments – viewed 40,423 times – ( +25 )
Large applications are often divided into front-end and back-end (or even more ends) depending on the target user groups. The front-end should be used by common users, while the back-end mainly the administrators or staff members. The two ends usually have dramatically different appearance, even though they may share a lot of code underneath. In this tutorial, we describe a way of organizing directories of the code for both ends.

How to use ldap in UserIdentity for authentication

Created 3 years ago by BeerSercTutorials10 comments – viewed 20,146 times – ( +11 )
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.

Getting to Understand Hierarchical RBAC Scheme

Created 2 years ago by daemonsTutorials10 comments – viewed 43,995 times – ( +50 )
Authentication and Authorization is a good tutorial. Among other topics, it describes basic aspects of Yii's RBAC implementation. But however hard I read the tutorial, I couldn't understand how exactly the hierarchy works. I found how to define authorization hierarchy, how business rules are evaluated, how to configure authManager, but almost nothing about how I should build my hierarchy, in what sequence its nodes are checked, when the checking process stops and what would be the checking result.

Caching the config main.php

Created about a year ago by dckurushinTutorials10 comments – viewed 7,930 times – ( +4 / -1 )
The config long array included every time, and it's not cached at all!

Understanding Scenarios

Created about a year ago by Luke JurgsTutorials9 comments – viewed 35,078 times – ( +20 )
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.

How to work with flash messages

Created 4 years ago by pfthTutorials9 comments – viewed 83,648 times – ( +48 )
Set your messages in a controller:

Setting and maintaining the language in Application (i18n)

Created 4 years ago by olafureTutorials9 comments – viewed 47,942 times – ( +19 )
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
tags: i18n, translation

Manage (Target) Language in Multilingual Applications + A Language Selector Widget (i18n)

Created about a year ago by c@cbaTutorials9 comments – viewed 14,581 times – ( +9 )
In case of a multilingual application, one might consider it a reasonable approach to store the preferred language of the user in a session variable, and after that, every time a page is requested, to check this session variable and render the page in the indicated language. This tutorial shows a Yii-way of doing this. We implement an event handler for the onBeginRequest event; as the name of the event suggests, this event handler will be called at the beginning of each request, so its a good place to check whether a language is provided (via post, session or cookie) and set the application language accordingly. We also implement a simple Language-Selector Widget, which can render the language options as ajax-links or as a drop-down list.