PHP code example of asinfotrack / yii2-webshell

1. Go to this page and download the library: Download asinfotrack/yii2-webshell library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

asinfotrack / yii2-webshell example snippets



class MyController extends \yii\web\Controller
{

	//...
	
	public function actions()
	{
		return [
			'my-shell-action'=>[
				'class'=>'asinfotrack\yii2\webshell\actions\ShellAction',
				'command'=>'php "c:\path\to\my_yii2_application\yii" my-console-command/index',
			],
		];
	}
	
	//...

}


<?= Button::widget([
	'label'=>'Run', 
	'options'=>[
		'data-shell-widget-run'=>'my-shell-widget',
	],
])