PHP Classes
elePHPant
Icontem

YII2 PHP Dashboard Panel: Controller and a widget to display dashboard panel

Recommend this page to a friend!
  Info   View files Documentation   View files View files (4)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2019-01-10 (10 days ago) RSS 2.0 feedNot yet rated by the usersTotal: 57 This week: 18All time: 9,361 This week: 27Up
Version License PHP version Categories
yii2-panel 1.0.0Freeware7PHP 5, Libraries, Content management
Description Author

This package provides a controller and widget to use with the YII2 framework to display a dashboard panel.

It provides a base class that can render panel widgets using a configuration file that defines a class that generates the contents of the widget.

The package also provides a base controller class that can define the dashboard panel behaviors configuration.

Name: Uldis Nelsons <contact>
Classes: 3 packages by
Country: Latvia Latvia
Age: 49
All time rank: 33429 in Latvia Latvia
Week rank: 22 Up1 in Latvia Latvia Up

Details

yii2 panel controller

Total Downloads

Simply dashboard solution. Each dashboard panel define in controller identicaly as Yii page: * in behaviors can control access - panel display only for users, who has access * create action. Can use parameters also * create view folder in same folder, where all other controller views

Installation by composer

{
    "require": {
       "unyii2/yii2-panel": "dev-master"
    }
}

Or

$ composer require unyii2/yii2-panel "dev-master"

Widget


echo \unyii2\yii2panel\PanelWidget::widget([
    'name' => 'exportSettings',
    'params' => [
        'docId' => 777
    ]
]);

Module config

        'invoices' => [
            'class' => 'd3modules\d3invoices\Module',
            'panels' => [
                'exportSettings' =>
                [
                    [
                        'route' => 'd3accexport/invoice-panel/document-settings',
                        'params' => [
                            'docId' => 13
                         ]
                     ]
                 ]
            ],
        ],

Panel controller with access control and view rendering

Standard view path: d3modules/d3accexport/views/invoice-panel/setting_grid.php

<?php

namespace d3modules\d3accexport\controllers;

use unyii2\yii2panel\Controller;
use yii\filters\AccessControl;

class InvoicePanelController extends Controller
{

    /
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                'rules' => [
                    [
                        'allow' => true,
                        'actions' => [
                            'document-settings',
                        ],
                        'roles' => [
                            'DocSetting',
                        ],
                    ],
                ],
            ],
        ];
    }

    public function actionDocumentSettings()
    {
        return $this->render('setting_grid',[]);

    }

}
  Files folder image Files  
File Role Description
Files folder imagesrc (2 files)
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file README.md Doc. Documentation

  Files folder image Files  /  src  
File Role Description
  Plain text file Controller.php Class Class source
  Plain text file PanelWidget.php Class Class source

 Version Control Unique User Downloads Download Rankings  
 100%
Total:57
This week:18
All time:9,361
This week:27Up