Yii2: Authorization without RBAC

While RBAC allows you to define collection of permissions for your application, sometimes you just want something simpler to control access to certain pages. The simplest way to define your …

Yii2: Posting Data via Link

This seems to be undocumented (or not so well documented) at the moment. Yii2 provides special supports which allows you to post data via clicking a link. Note: Line 3: Specifying …

Yii2: Processing jQuery Ajax

This is skeleton code example on posting form data in JSON format processing by Yii’s controller action. Although this example uses Yii, the code can be easily adaped to pure PHP …

Yii2: Include View Specific JavaScript

To include JavaScript for specific action, either the JavaScript code or file is to be registered in view file. Method 1: Register JavaScript File Use registerJsFile(). Note: optional position. values: POS_HEAD, POS_BEGIN, POS_END. …

Yii2: Ajax Gridview

Want to navigate through the grids or trying to sort and filter data without waiting for the entire page to load? You need yii\widgets\Pjax and wrap it around GridView. In the view: …