This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.
This wiki explains how to add calculated fields into your Yii Framework 2.0 gridview with filtering and sorting.
There are a few issues with the other solutions I originally used that I found from other wikis. I address the issues I had in this much simpler and shorter way. I am also going to explain what is going into way more detail than others to help people understand what's going on.
One of the things you will find tricky to implement is the the sorting and filtering of a GridView's column that displays related model data.
There is an issue on Yii2 to redirecting / urls to /frontend/web.
In other words we need a way to hidden /frontend/web from addresses.
We will do this without changing Apache configuration and creating virtual host or setting document root (It's good for share hostings that we have not access to apache.conf)
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...
You would find having such a need in most Yii Projects. Your database needs a specific format to store date fields, while you may want to display it in different formats to the users on forms and other views.
Here is a example on how to use Pjax with GridView (yii\grid\GridView) and ActiveForm (yii\widgets\ActiveForm) widgets in Yii2.
I am writing this guide because I struggled to find a resource that included ALL of the necessary steps to completely separate the frontend from the backend. After reading guides like Configuring different sessions for backend and frontend in yii-advanced-app and [yii2 configuring d...
In advance template there is already a file yii. And there is no need to run it as php, it is Linux script.
This wiki explains how to add summary data from related models into your Yii Framework 2.0 gridview with filtering and sorting by the summary columns.
Yii2 comes with a charming twitter bootstrap version 3. But if it is less, then you can integrate with web templates that you like. One example is wonderfull template "adminLTE"
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.
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.
Let's assume we have two models: Customer and Supplier and we want both to log in. Yii is quite flexible when it comes to authentication and authorization so it's possible.
If you develop rather complex applications with Yii2, you might already be familiar with yii2-app-advanced application template. Well, the template is awesome and provides high flexibility regarding code/configuration sharing among parts of an application.
JWT is short for JSON Web Token. It is used eg. instead of sessions to maintain a login in a browser that is talking to an API - since browser sessions are vulnerable to CSRF security issues. JWT is also less complicated than setting up an OAuth authentication mechanism.
Welcome, all of you !
The Problem: Yii2 utilizes by default UserIdentity configured in config/web.php for connection, this object apply one table to authentication ('identityClass' => 'app\panel\models\User'). How to authentication from diferent tables? Solution: Create instances in web.php to uses UserIdentify. eg:
Step 1: Initialize the Bootstrap Tooltip & Popover plugins in your view layout file @web\views\layouts\main.php
. Add this to somewhere in the beginning head section (after you have loaded the Jquery using your AppAsset or something similar).
The only differences in Yii 2 is that its much simpler due to available functions in the Model class for loading and validating models.