PHPackages                             drsdre/yii2-radtools - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Admin Panels](/categories/admin)
4. /
5. drsdre/yii2-radtools

ActiveYii2-extension[Admin Panels](/categories/admin)

drsdre/yii2-radtools
====================

Rapid Application Development tools to quickly build interconnected crud UI. Uses yii2-ajaxcrud to generate the pop-up forms and (optionally) kartik-v's Dynagrid.

3.2.2(7y ago)1803Apache-2.0PHPPHP &gt;=7.0.0

Since Dec 7Pushed 7y ago3 watchersCompare

[ Source](https://github.com/drsdre/yii2-radtools)[ Packagist](https://packagist.org/packages/drsdre/yii2-radtools)[ RSS](/packages/drsdre-yii2-radtools/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (10)Dependencies (6)Versions (28)Used By (0)

Yii2 RAD Tools
==============

[](#yii2-rad-tools)

[![Build Status](https://camo.githubusercontent.com/c7acf5a91a7eb8c942d2cf823e1f4cace855c2381b6f4db7da362630827a4549/68747470733a2f2f7472617669732d63692e6f72672f6472736472652f796969322d726164746f6f6c732e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/drsdre/yii2-radtools)

Rapid Application Development controller for quick and complete crud interfaces to linked database models. It supports [yii2-ajaxcrud](https://github.com/johnitvn/yii2-ajaxcrud) for modal based crud forms (pop-ups), [kartik-v/Dynagrid](https://github.com/kartik-v/yii2-dynagrid) for the Gridview and [kartik-v/yii2-detail-view](https://github.com/kartik-v/yii2-detail-view) for integrated view/update/create forms.

The controller comes with the following build-in actions:

- index: full page using build in or kartik-v GridView
- view: either full page or using yii2-ajaxcrud modal
- create: either full page or using yii2-ajaxcrud modal
- copy: either full page or using yii2-ajaxcrud modal
- update: either full page or using yii2-ajaxcrud modal
- delete: either full page or using yii2-ajaxcrud modal
- bulkUpdate: for bulk actions from GridView
- bulkDelete: for bulk actions from GridView

All actions can be configured to have specific success URL's and custom variables to be send to the view. When a 'return\_url' GET parameter with the action, it will overrule the success URL.

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

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
-----

[](#usage)

Once the extension is installed, simply 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, simply extend from AjaxCrudHierarchyLinkController and setup $hierarchy\_links parameter:

```
class TableController extends drsdre\radtools\AjaxCrudHierarchyLinkController
{
    protected $useDetailView = true;
    protected $useDynagrid = true;
    protected $modelClass = 'app\models\UserForm';
    protected $searchModelClass ='app\models\search\UserSearch';
    protected $model_name = 'User';
    protected $model_field_name = 'username';
    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}',
    				]
    			]
    		]
    	];
```

Bulk update &amp; delete
------------------------

[](#bulk-update--delete)

The bulk-update and bulk-delete actions are enabled by default in BaseAjaxCrudController. They are added in the view using the BulkButtonWidget.

Bulk-update uses the model scenario that can be set on a single update action. You can add form elements for changing the data to the 'data-confirm-message'. Use the exact field name of the model (this is auto-mapped in the action). The 'data-confirm-ok' field is used to build the submit button which pushes.

For example:

```
