"By Example" cookbook pages will provide coding examples for many of the commonly used classes within Yii. We will try to provide as many usage examples as possible for keep these pages as helpful as possible.
"By Example" cookbook pages will provide coding examples for many of the commonly used classes within Yii. We will try to provide as many usage examples as possible for keep these pages as helpful as possible.
The issue is covered in "The Definite Guide to Yii" (Error Handling - Handling Errors Using an Action).
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.
Below I have created an Html helper with methods to help me locate directories of my assets dynamically. Such assets may include CSS, JavaScript and images.
These features provide endless possibilities and unbelievable flexibility, but as current documentation does not give more than a few examples, it might be difficult to fully understand their internals and requirements.
After adding proper form to the main layout, like:
Yii's ActiveRecord classes are powerful, but they fall short when you want to have a configurable table prefix for your application.
While yiic shell
tool is very convenient at generating skeleton code in our application, the generated code is not always what we want. For example, we may want the generated code to carry specific copyright information; we may want to use our own coding style; we may want to add more features; and so on. All these can be accomplished easily in Yii.
Adding HTTP compression to your application could never have been easier!
When you need to integrate with other frameworks (e.g. Zend Framework), you have to follow these steps:
This tutorial will show you how to use the Pogostick Yii Extension Library to make an HTML TEXTAREA input element into a full-fledged WYSIWYG editor pretty much with very little code.
Here is a quick tutorial for connecting Yii with Twitter using the Pogostick Yii Extensions Library.
Logging context information (session, user, ...) to the logfile can be of great help tracking down problems with specific users.
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...
Application configuration determines how an Yii application should behave, because it is the only parameter passed in the entry script. An application, on the other hand, needs to behave differently under different circumstances. For example, an application may need different configurations when running in production mode, development mode and testing mode; In a team development environment, each...
Because Yii intends to be integrated nicely with third-party libraries, it does not define any global functions. Everything in Yii needs to be addressed with full class name or object scopes. For example, to access the current user, we need to use Yii::app()->user
; to access application parameters, we need Yii::app()->params['name']
; and so on. While editors like textmate
can help alleviate...
Since Yii 1.0.5 you can use named scopes with ActiveRecords. They are a great help in simplifying your query calls.
This is the first real problem that I encountered using Yii, trying to make a Model input repeatable in the form, validate and save them.
In this tutorial, we describe how to implement multiple layouts for action views in an application. As an example, we assume that the pages in our application will use three different layouts:
The Yii documentation states: