2017 © Pedro Peláez
 

yii2-extension admin

Admin pack (actions, widgets, etc) for Yii2

image

yii2tech/admin

Admin pack (actions, widgets, etc) for Yii2

  • Monday, April 9, 2018
  • by klimov-paul
  • Repository
  • 12 Watchers
  • 93 Stars
  • 6,436 Installations
  • PHP
  • 4 Dependents
  • 0 Suggesters
  • 20 Forks
  • 0 Open issues
  • 7 Versions
  • 6 % Grown

The README.md

, (*1)

Admin pack for Yii 2


This extension provides controllers, actions, widgets and other tools for administration panel creation in Yii2 project., (*2)

For license information check the LICENSE-file., (*3)

Latest Stable Version Total Downloads Build Status, (*4)

Installation

The preferred way to install this extension is through composer., (*5)

Either run, (*6)

php composer.phar require --prefer-dist yii2tech/admin

or add, (*7)

"yii2tech/admin": "*"

to the require section of your composer.json., (*8)

Usage

This extension provides controllers, actions, widgets and other tools for administration panel creation in Yii2 project. These tools are meant to be used together for the rapid web application administration panel composition., (*9)

This package supports usage of following extensions:, (*10)

Note: none of these extensions is required by default, you'll need to install them yourself, if needed., (*11)

Actions

This extension provides several independent action classes, which provides particular operation support:, (*12)

  • [[\yii2tech\admin\actions\Index]] - displays the models listing with search support.
  • [[\yii2tech\admin\actions\Create]] - supports creation of the new model using web form.
  • [[\yii2tech\admin\actions\Update]] - supports updating of the existing model using web form.
  • [[\yii2tech\admin\actions\Delete]] - performs the deleting of the existing record.
  • [[\yii2tech\admin\actions\View]] - displays an existing model.
  • [[\yii2tech\admin\actions\SoftDelete]] - performs the "soft" deleting of the existing record.
  • [[\yii2tech\admin\actions\SafeDelete]] - performs the "safe" deleting of the existing record.
  • [[\yii2tech\admin\actions\Restore]] - performs the restoration of the "soft" deleted record.
  • [[\yii2tech\admin\actions\Callback]] - allows invocation of specified method of the model.
  • [[\yii2tech\admin\actions\Position]] - allows change custom sort position of the particular model.
  • [[\yii2tech\admin\actions\VariationCreate]] - supports creation of the new model with variations using web form.
  • [[\yii2tech\admin\actions\VariationUpdate]] - supports updating of the new model with variations using web form.
  • [[\yii2tech\admin\actions\RoleCreate]] - supports creation of the new model with role using web form.
  • [[\yii2tech\admin\actions\RoleUpdate]] - supports updating of the new model with role using web form.

Please refer to the particular action class for more details., (*13)

For example CRUD controller based on provided actions may look like following:, (*14)

namespace app\controllers;

use yii\web\Controller;

class ItemController extends Controller
{
    public function actions()
    {
        return [
            'index' => [
                'class' => \yii2tech\admin\actions\Index::class,
                'newSearchModel' => function () {
                    return new ItemSearch();
                },
            ],
            'view' => [
                'class' => \yii2tech\admin\actions\View::class,
            ],
            'create' => [
                'class' => \yii2tech\admin\actions\Create::class,
            ],
            'update' => [
                'class' => \yii2tech\admin\actions\Update::class,
            ],
            'delete' => [
                'class' => \yii2tech\admin\actions\Delete::class,
            ],
        ];
    }

    public function findModel($id)
    {
        if (($model = Item::findOne($id)) !== null) {
            return $model;
        }
        throw new NotFoundHttpException('The requested page does not exist.');
    }

    public function newModel()
    {
        return new Item();
    }
}

Controllers

This extension provides several predefined controllers, which can be used as a base controller classes while creating particular controllers:, (*15)

  • [[\yii2tech\admin\CrudController]] - implements a common set of actions for supporting CRUD for ActiveRecord.

Please refer to the particular controller class for more details., (*16)

Widgets

This extension provides several widgets, which simplifies view composition for the typical use cases:, (*17)

  • [[\yii2tech\admin\widgets\Alert]] - renders a message from session flash.
  • [[\yii2tech\admin\widgets\ActionAlert]] - renders an action proposition based on particular condition, usually a session flag.
  • [[\yii2tech\admin\widgets\ButtonContextMenu]] - simplifies rendering of the context links such as 'update', 'view', 'delete' etc.
  • [[\yii2tech\admin\widgets\Nav]] - enhanced version of [[\yii\bootstrap\Nav]], which simplifies icon rendering.

Also several enhancements for the [[\yii\grid\GridView]] are available:, (*18)

  • [[\yii2tech\admin\grid\ActionColumn]] - simplifies composition of the action buttons
  • [[\yii2tech\admin\grid\DeleteStatusColumn]] - serves for the 'soft-deleted' status displaying
  • [[\yii2tech\admin\grid\PositionColumn]] - provides simple interface for the model custom sort position switching
  • [[\yii2tech\admin\grid\VariationColumn]] - allows displaying of the variation column values

Using Gii

This extension provides a code generators, which can be integrated with yii 'gii' module. In order to enable them, you should adjust your application configuration in following way:, (*19)

return [
    //....
    'modules' => [
        // ...
        'gii' => [
            'class' => yii\gii\Module::class,
            'generators' => [
                'adminMainFrame' => [
                    'class' => yii2tech\admin\gii\mainframe\Generator::class
                ],
                'adminCrud' => [
                    'class' => yii2tech\admin\gii\crud\Generator::class
                ]
            ],
        ],
    ]
];

"MainFrame" generator creates a basic admin panel code, which includes layout files, main controller file and basic view files. The created structure is necessary for the correct rendering of the code created by "Admin CRUD" generator., (*20)

"Admin CRUD" generator is similar to regular "CRUD" generator, but it generates code, which uses tools from this extension, so the result code is much more clean., (*21)

Internationalization

All text and messages introduced in this extension are translatable under category 'yii2tech-admin'. You may use translations provided within this extension, using following application configuration:, (*22)

return [
    'components' => [
        'i18n' => [
            'translations' => [
                'yii2tech-admin' => [
                    'class' => yii\i18n\PhpMessageSource::class,
                    'basePath' => '@yii2tech/admin/messages',
                ],
                // ...
            ],
        ],
        // ...
    ],
    // ...
];

The Versions

09/04 2018

2.0.x-dev

2.0.9999999.9999999-dev

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

09/04 2018

dev-master

9999999-dev

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

09/04 2018

1.1.0

1.1.0.0

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

09/04 2018

1.0.3

1.0.3.0

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

03/11 2017

1.0.2

1.0.2.0

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

19/04 2017

1.0.1

1.0.1.0

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 crud admin administration

06/01 2017

1.0.0

1.0.0.0

Admin pack (actions, widgets, etc) for Yii2

  Sources   Download

BSD-3-Clause

The Requires

 

The Development Requires

by Paul Klimov

yii2 admin