Skip to content
This repository has been archived by the owner on Sep 9, 2019. It is now read-only.

[Feature suggestion] Controller configuration data support in base Module class #67

Closed
mikolaj-milewski opened this issue Jul 22, 2015 · 4 comments
Assignees

Comments

@mikolaj-milewski
Copy link

\yii\base\Controller accepts configuration data array as constructor param, but \yii\base\Module::createController() nor \yii\base\Module:: createControllerByID() don't. I suggest to add param $config = [] to both of these methods and pass it further to created controller.

@samdark
Copy link
Member

samdark commented Jul 22, 2015

Can't be done in 2.0.x because of backwards compatibility.

@mdmunir
Copy link
Contributor

mdmunir commented Sep 10, 2015

'controllerMap'=>[
   'my'=>[
        'class' => 'app\controllers\MyController',
        'param1' => 'something',
        'param2' => 'another',
    ]
]

@samdark samdark self-assigned this Sep 15, 2015
@SamMousa
Copy link
Contributor

@mikolaj-milewski You could configure the controllers via Dependency Injection

http://www.yiiframework.com/doc-2.0/guide-concept-di-container.html

@samdark samdark transferred this issue from yiisoft/yii2 Nov 3, 2018
@samdark
Copy link
Member

samdark commented Aug 9, 2019

Closing since implementation is too different now.

@samdark samdark closed this as completed Aug 9, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants