Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 81-90 of 240 result(s).

Drills : Search by a HAS_MANY relation in Yii 1.1

Created 2 years ago by softarkTutorials13 comments – viewed 33,536 times – ( +32 ) – version 1.1
Sometimes we get lost trying to search by a HAS_MANY relation using CActiveRecord or CActiveDataProvider in Yii 1.1. This article is a series of drills that try to describe the practical techniques of searching by a HAS_MANY relation.

Adding login form to each page

Created 5 years ago by pestaaTutorials5 comments – viewed 33,520 times – ( +3 / -2 ) – version 1.1
After adding proper form to the main layout, like:

To configure Yii path in Windows platform

Created 4 years ago by CodaTutorials2 comments – viewed 33,045 times – ( +3 / -6 ) – version 1.1
I can see many questions regarding configuring the path using Windows OS. I could hardly get the right information about it. The cook book has defined for Linux. So I would like to share my idea on it. To configure the Yii path using Windows OS,

Manage application configuration in different modes

Created 6 years ago by qiangTutorials5 comments – viewed 32,864 times – ( +16 ) – version 1.1
Info: This tutorial references the idea presented in Jonah's excellent blog article.

Simple access control

Created 2 years ago by szfjozsefTutorials4 comments – viewed 32,404 times – ( +4 / -8 ) – version 1.1
For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

Setting application parameters dynamically in the back-end

Created 3 years ago by PablovpTutorials6 comments – viewed 32,115 times – ( +12 / -1 ) – version 1.1
I was wondering how to set-up the application parameters in the back-end to use them all around the application without the need of using the database and I came up with this solution, I hope it helps somebody else.

Building a REST API in Yii2.0

Created 8 months ago by sirin kTutorials5 comments – viewed 30,998 times – ( +5 ) – version 2.0
This is wiki page is useful if you are trying to build a customized REST API in Yii2.0
tags: yii2.0, REST API

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

Created 3 years ago by c@cbaTutorials10 comments – viewed 29,979 times – ( +15 ) – version 1.1
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.

Add information to Yii::app()->user by extending CWebUser (better version)

Created 4 years ago by emixTutorials5 comments – viewed 29,378 times – ( +5 / -1 ) – version 1.1
I found a better solution.
tags: Yii, user, rbac

CSS Naming Conventions

Created 4 years ago by qiangTutorials4 comments – viewed 28,692 times – ( +35 / -1 ) – version 1.1
In this article, we introduce a set of CSS naming conventions that we have applied in several big projects and achieved success. The goal of these naming conventions is to eliminate the possibility of naming conflicts, facilitate debugging and maintenance, and to simplify the naming process.