This wiki describes a more complex workflow using the XUpload widget
This wiki describes a more complex workflow using the XUpload widget
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest
class wraps various $_SERVER
variables to break down the URL into its constituent parts.
This little tutorial explains a way how you can retrieve more parameters from Yii::app()->user by adding a component that extends CWebUser and retrieves the user information from database table named User.
When creating web-application projects, you can add a great variety of different extensions, modules, plugins or scripts to your code-base. But maintaining a stable combination and updating certain packages can become a hard task.
Please note that this article is a simple example and good security should be taken into account when we play with authentication systems.
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:
Previously there was described a way to build an application with front-end and back-end. I would like to continue this theme and suggest another way to organize directories using WebApplicationEnd behavior.
CGridView (or CListView) together with CActiveDataProvider is a very powerful combination of the built-in tools of Yii. But how do they work together to accomplish their fantastic functions? And what are you expected to do to use them and to customize their behaviors? This article explains the very basics of them.
In this tutorial will be explained a method to manage some configuration runtime. This excellent tutorial follows a similar approach, but requires to write a masterclass which all controllers are supposed to extend, following this wiki you can achieve the same by only editing the configuration.
Cookie management in Yii is easy, but may not be so obvious for the beginners to this framework, so I wrote this simple article to clear some doubts out.
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 direc...
The official Yii project site now supports OpenSearch. This means you can customize your browser's search box to enable direct search of the content in yiiframework.com. For example, by entering a Yii class name in the browser's search box, the corresponding class API page will be shown in the browser.
Checkboxes have two possible values, true
and false
, but some applications require that the user select one particular value before proceeding. Examples might be:
First declare an attribute to store the file name in the model class (either a form model or an active record model).
Also declare a file
validation rule for this attribute to ensure a file is uploaded with specific extension name.
All done, now we can call all the actionProvider actions as controllerID/actionPrefix.actionID. Here is the example:
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.
With yii you're able to create ajax requests and updates easily. But most times you always want to show a loading indicatior to your user.
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".
Since I used CGridView for a first time, I didn't like how it handled operations like sorting, filtering, changing page and etc using AJAX.
Many desktop programmers are used to having dynamic forms, where clicking on a record in a parent sub-form, updates another sub-form with the child records. While having many levels of nested sub-forms in a single view might not be such a good idea for a web application, I thought doing it one level deep might be interesting and useful. But, instead of sub-forms I used CGridViews.