Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.
Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.
This tutorial assumes some basic knowledge of Yii and a functional development environment.
There are scenarios when you work with DVCS (like [Mercurial]( http://mercurial.selenic.com/) or [Git]( http://git-scm.com/)) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very...
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.
Here is a way to dynamically extend tabs based on clips.
Probably even more complex things could be done.
Validators extending from [CValidator] all have a property named [message|CValidator::message]. You can set this property in the corresponding validation rule to customize the error message. For example, the following validation rule uses an error message that is different from the default one:
There are many ways to automate the setting of timestamps in yii ActiveRecord models. Three are presented here:
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a [CActiveRecord] Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecor...
A dropdown list can be used to select a value, based on which we can filter the data to be displayed. For example, the extension page has a dropdown list to filter the displayed extensions according to the selected category.
This page assumes that you have installed Wampserver on your MS Windows computer.
Once you are completed with the "Creating First Yii Application", the following can be done.
By default, the expression Yii::app()->user returns a [CWebUser] [application component](http://www.yiiframework.com/doc/guide/basics.application#application-component) which represents the information that are closely related with the current user. Some information can be persistent throughout the current user session. For example, [CWebUser] already comes with a [name|CWebUser::name] property th...
This behavior will automatically set timestamp fields to the row creation and modification times.
Yii core messages refer to static text strings in the core Yii framework code which are meant to be displayed to end-users (e.g. core exception messages, default validation error messages). Customization of these core messages is needed in two circumstances:
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:
Web feed is a data format used for providing users with frequently updated content. In this article, we describe how to use Zend_Feed, an excellent component from Zend Framework to generate Web feed for an Yii application. This article can also serve as a general guide...
Here's a simple way to create a breadcrumb widget to be used in your templates. The idea is just to isolate how the breadcrumb is generated based on an array of crumbs.
As seen in this post, Yii doesn't enforce how language is set and maintained within the session.
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.
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...