A simple trick to get the localized version of a model field is to add this little method to your models.
A simple trick to get the localized version of a model field is to add this little method to your models.
In this guide I will explain best practise regarding performance in MySQL, PHP and of course our loved Yii Framework. Since this is a complex topic, I will start with some basics and then expand this guide from time to time. Since this wiki can become big, you may click on View history
- there you can see what changes have been made, so you don't miss anything.
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.
Yii does not have an LDAP class itself, but its very easy to implement LDAP in the stock UserIdentity class.
Note: Please also take a look at the newer EMenu extension. This works even better that the deprecated CDropDownMenu!
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.
The purpose of this post is to let anyone quickly find how to accomplish a configuration task, and list here all the posibilities of the config.php file and also link to pages that explain how is each thing implemented.
During development, it's often very handy to have SQL logging and profiling.
This guide is for more or less advanced users. If you just started with Yii or didn't worked with any web-framework before, you may should come back later :-)
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.
The Definitive Guide introduces the fundamentals of managing URLs in a Yii application. In this tutorial, we introduce a practical technique that can quickly turn your application into using search-engine-friendly URLs.
This method was inspirated on the excellent text about different environments available at http://www.yiiframework.com/doc/cookbook/32/
This is a central location to collect links to "Getting Started" documentation beyond the blog demo and Creating First Yii Application. Please help the community by adding general, introductory links and descriptions to this page.
The easiest way to update content in AJAX is to use the renderPartial method.
"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: