common\components\LanguageSelector.php
<?php
namespace common\components;
common\components\LanguageSelector.php
<?php
namespace common\components;
It's well known that there are Lazy Loading approach and Eager Loading approach in the relational query. But it's very important to know how the Eager Loading approach works in Yii 2. It has changed drastically from that of Yii 1.1, and there are common misunderstandings about it in the community.
namespace app\components;
To use jui auto complete widget first add
Here is a small guide how to get console commands running inside modules & extensions. For this guide I used a fresh yii2 basic application template.
To generate excel by query content, and download through any controller. You also can bind cssClass to header/odd/even rows. As for header, you even can set cssClass for each column.
$this->export2excel($excel_content,$excel_file);
in your controller.
One of the common tasks the web application might be required to perform, especially the app using some kind of a CMS, is to save the history of data changes. Your client for sure will want the answer to this simple question - If I mess this up or delete by accident can we bring it back? Well, DB backup is one thing and quick recovery is another - let's talk about latter one.
When building PHP web applications you usually have to take care about defining and providing a consistent development and production environment for your team. This includes your application packages, PHP-extensions, database servers and often further components such as a mail server or workers.
This article tries to describe the practical techniques of searching by a HAS_MANY relation using ActiveRecord of Yii 2.0.
Example settings when using Gettext for i18n.
One of the common requests I see in the forum is how to implement RBAC. While you can implement Yii 2's built-in RBAC, that might be too much for developers who are just starting with Yii 2 or have simpler needs. Sometimes you are looking for a fast solution and just want two flavors, user and admin. And even if you will eventually need more, you can use these methods as a starting point for devel...
This tutorial need extension mdmsoft/yii2-upload-file. Follow the intruction to install.
After installation done, create controller
and action
Imagine adds most common image functions and also acts as a wrapper to Imagine image manipulation library.
I wanted to customize the CJuiAutoComplete, so that it displays a thumb image before the label like the one shown in the following image:
This is wiki page is useful if you are trying to build a customized REST API in Yii2.0
Translation from .txt file Note:
Hi Friends, In this tutorial I write a code display dependent drop-down value using ajax call.
In this wiki I will show how could forcing login for all pages and users must be logged in to access almost all of the site’s content.