yii2-radtools Rapid Application Development tools to quickly build interconnected crud UI.

  1. Yii2 RAD Tools
  2. Installation
  3. Usage

Yii2 RAD Tools

Rapid Application Development tools to quickly build interconnected crud UI's. It uses yii2-ajaxcrud to generate the pop-up forms and optionally kartik-v/Dynagrid for the Gridview.

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist drsdre/yii2-radtools "*"

or add

"drsdre/yii2-radtools": "*"

to the require section of your composer.json file.

Usage

Once the extension is installed, simple extend from BaseAjaxCrudController and add settings:

class UserController extends drsdre\radtools\BaseAjaxCrudController
{
    protected $useDynagrid = true;
    protected $modelClass = 'app\models\UserForm';
    protected $searchModelClass ='app\models\search\UserSearch';
    protected $model_name = 'User';
    protected $model_field_name = 'username';

To use hierarchy links, include the HierarchyLinkTrait (it requires the controller to be extended from BaseAjaxCrudController):

class TableController extends drsdre\radtools\BaseAjaxCrudController
{   
    protected $useDynagrid = true;
    protected $modelClass = 'app\models\UserForm';
    protected $searchModelClass ='app\models\search\UserSearch';
    protected $model_name = 'User';
    protected $model_field_name = 'username';
        
   use drsdre\radtools\HierarchyLinkController;

   protected $hierarchy_links = [
    		'user_id' => [
    			'model' => 'app\models\User',
    			'linked_model' => 'user',
    			'breadcrumbs' => [
    				[
    					'label' => 'Users',
    					'url' => '/user/overview',
    				],
    				[
    					'label' => '{model_name}',
    					'name_field' => 'username',
    					'url' => '/user/view?id={id}',
    				]
    			]
    		]
    	];

TODO add explanations for the parameters.

0 0
1 follower
0 downloads
Yii Version: 2.0
License: Apache-2.0
Category: User Interface
Developed by: drsdre
Created on: Dec 7, 2016
Last updated: 7 years ago

Related Extensions