I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
I wanted to keep all the I18N related translations in separate files, so that I would not need to modify the view files or the model files every time I need to update or fix the translations of application's source language.
If you started playing with Yii2's new GridView, you will soon realize that some things have improved quite a lot, but I am sure its going to be a bit confusing at first glance when you try to modify certain javascript behaviors like for example, its delete confirmation dialog box.
I www.jamesbarnsley.com was tasked to find a way to do recursive deletion in Yii. As I asked other developers and looked around the internet the usual answers all came up, use a plugin or use cascade delete at the DB level, but I did not want to do either of these.
I (www.jamesbarnsley.com) found that when using the Yii Bootstrap tabs component you will sometimes want to direct the user to a specific tab and not necessarily the first tab. Yii Bootstrap already provides the "active" variable so you can define whether the tab is the active tab or not in PHP. I generally find though that a PHP solution to...
common\components\LanguageSelector.php
<?php
namespace common\components;
The only differences in Yii 2 is that its much simpler due to available functions in the Model class for loading and validating models.
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's important to note that you should distinguish 2 different modes in the Eager Loading in Yii 1.1.x.
Imagine adds most common image functions and also acts as a wrapper to Imagine image manipulation library.
Lately, i needed to deal with the following scenario: read from two databases (db1,db2), and write to a third database (db3).
namespace app\components;
You have that, when a product is on development they can change its API anytime. This change is quite important though, its related on how to set the events of your form, for example, the useful beforeSubmit.
It can happen that you work in development environment and you make changes to database tables structures, adding tables, or changing fields.
All done, now we can call all the actionProvider actions as controllerID/actionPrefix.actionID. Here is the example:
To use jui auto complete widget first add
I've gotten Yii running cron jobs, and wanted to explain briefly how I did it.
Original source code and idea are from: PHP, PDO & Nested Transactions.
As for complexity SQL query we have two solutions as below, I will discuss #2 in this article.
The Google mapping extension by Dos Amigos (link) is really great but there are difficulties with Google maps when you want to manipulate your map object with Ajax.
It's easy to execute migration locally on XAMPP using cmd, but on server where you script is it's little bit harder.