Generally we need to show one or more fields from a model that is related to another model used in CGridView. For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".
Generally we need to show one or more fields from a model that is related to another model used in CGridView. For our case we will use two related models, which explain how to use model "A" fields in a CGridView that used model "B".
Use this extension : yii2-relation-trait
Search Models are a very elegant and powerful way to build an Active Data Provider. If you use them a lot, you'll quickly need to use scenarios, which will lead you to a very DRY Controller code.
I leverage Kartik's notification widgets.
I faced many issues when hosted our company website on AppFog.
I'm using PayPal's script from
This tutorial is explained following "basic" application structure.
Your application is international and you have to select the best language for the user. Your user may have selected 'fr_CA' and you have 'fr_FR' or 'fr' available. What do you do? Here is a tip.
Introduction
solution here If we are using default pagination option like
Let's say, for example, that you are developing a blog or some kind of CMS and you want to track the number of times each post was viewed (maybe to show a list of the most viewed ones).
If you are coming over from Yii 1.x to Yii 2, and already read this guide, you may note that namespaces are very important in Yii 2 to identify classes. But do you know the list of seeded path aliases that come shipped with a basic or advanced app? Here is my attempt to list them.
What I want to achieve:
The CMenu class provides some useful features for generating menus in your web application.
yii rights some tips..
Does your application need to know user's details on browser details, os and device type? We can use PHP's misc. function to achieve that provided you have an update copy of browsercap.ini
Modern browsers support SVG, older browsers do not. This replacement for CHtml::image() allows you to handle to propose SVG in an efficient way with PNG as a fallback.
First of all, install yii2 basic template according below link:
We will leverage Yii2-excelview widget. So, first of all is install Yii2-excelview:
There are cases that model validators should be depended by controller/action and you couldn't manipulate on the model class or using scenarios in easy way