Logging context information (session, user, ...) to the logfile can be of great help tracking down problems with specific users.
Logging context information (session, user, ...) to the logfile can be of great help tracking down problems with specific users.
When one needs to select a record in a table that do not have related records through a relation, it is generally suggested to use a subquery. Personnaly, I prefer a high level approach, and I have a method to do it with scopes.
This is a simple example that will give you a base for designing a database driven menu system that will use CMenu to be rendered.
Yii's ActiveRecord classes are powerful, but they fall short when you want to have a configurable table prefix for your application.
The giix code generator has out of the box i18n support for model names and attribute labels (besides other cool features > check it out!) .
But I want to factor in not only the plural form, but also the grammatical cases (especially the accusative) while translating 'Manage Objects', 'Create Object', 'Edit Object' etc.
The most difficult thing in a big project, is to manage conflicts with files modified by others users. Git can do this work for us.
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.
Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).
pagoda box is very useful tool for a programmer to test their php app online so its very useful one. For deploying code pagodabox use git command
A simple trick to get the localized version of a model field is to add this little method to your models.
$this->render('index', array(
'dataProvider' => $dataProvider,
));
`
This article discusses how one can run a long task in background in yiiframework 1.1 using Ajax technique.
This tutorial assumes some basic knowledge of Yii and a functional development environment.
Just thought I would share this bash script I wrote to help automate a base install of YII on an Ubuntu server. This script does the following:
Sometime, in a many-to-many relation, you need to retrieve AR that aren't linked. In practice, AR with null value in the join table. So you implements a criteria like this :
public function scopeUnused( $useAnd = true )
{
$join = " left outer join composed_by j on t.ID = j.ID ";
$condition = ' j.ID Is Null';
This article discusses the installation/configuration of the YiiBash project (https://github.com/dsoprea/YiiBash).