asolomatin/php-console-yii2

There is no license information available for the latest version (dev-master) of this package.

PhpConsole wrapper for Yii2

dev-master 2017-08-21 08:20 UTC

README

PhpConsole wrapper for Yii 2

Based on https://github.com/barbushin/php-console-yii

Configuration Example

Into common/main.php 'components' => [ 'phpconsole' => [ 'class' => '\nilsburg\PhpConsole\PhpConsole', 'isEvalEnabled' => true, 'password' => 'some_password' ], ]

Usage (Eval)

public function beforeAction($action)
{
    if ($action->id === 'index') {
        $this->enableCsrfValidation = false;
    }
    return parent::beforeAction($action);
}

public function actionIndex()
{
    $console = \Yii::$app->phpconsole;
    unset($console);
    return $this->render('index');
}