Yii can call controller action from another controller
Yii framework has runController method https://www.yiiframework.com/doc/api/1.1/CWebApplication#runController-detail It is additional feature which classic MVC frameworks dont have
Yii framework has runController method https://www.yiiframework.com/doc/api/1.1/CWebApplication#runController-detail It is additional feature which classic MVC frameworks dont have
<?php echo $query->createCommand()->sql;
<?php return Yii::$app->response->sendFile($fileName);
Step 1: app/config/console.php ‘log’ => [ ‘traceLevel’ => YII_DEBUG ? 3 : 0, ‘targets’ => [ [ ‘class’ => ‘app\helpers\MyFileTarget’, ‘exportInterval’ => 1, ‘categories’ => [’my-category’], ‘except’ => [’application’], ‘levels’ => [’trace’], ‘logFile’ => ‘@app/runtime/logs/my-category.log’, ], ], ], Step 2: Create file app/helpers/MyFileTarget.php <?php namespace app\helpers; use Yii; use yii\log\Logger; use […]
To make the following url work: http://www.website.com/green-juice add the following rule to config/web.php ‘urlManager’ => [ ‘enablePrettyUrl’ => true, ‘showScriptName’ => false, ‘rules’ => [ ‘green-juice’=>’green/say’, ] ]
Edit file config/web.php Add the following to the ‘components’ array: ‘components’ => [ ‘urlManager’ => [ ‘enablePrettyUrl’ => true, ‘showScriptName’ => false, ]
Edit config/main.php (or config/web.php), add or remove the following code: $config[‘bootstrap’][] = ‘debug’; $config[‘modules’][‘debug’] = ‘yii\debug\Module’;