nvlad / yii2support

Yii2 Support for PhpStorm / IntelliJ IDEA
https://plugins.jetbrains.com/idea/plugin/9388-yii2-support
Other
295 stars 54 forks source link

Action and Controller in separate files #269

Open thiagotalma opened 3 years ago

thiagotalma commented 3 years ago

It would be great to be able to use the views tools when the action is separate from the controller, in different files, as in the example below.

Is there any possibility?

class DemoController extends Controller
{
    public function actions()
    {
        return ArrayHelper::merge(parent::actions(), [
            'view' => ViewAction::class,
        ]);
    }
}
class ViewAction extends Action
{
    public function run($id)
    {
        $model = Model::findOne($id);

        return $this->controller->render('view', [
            'model' => $model,
        ]);
    }
}