phemellc / yii2-settings

Yii2 Settings Module
Other
151 stars 74 forks source link

Overiding models, controllers, and view #20

Open xiandalisay opened 9 years ago

xiandalisay commented 9 years ago

Is there any documentation how to override the MVC? For example documenation. https://github.com/dektrium/yii2-user/blob/master/docs/overriding-views.md

In my case, if the value is integer, maybe i want to dynamically relate it to another. using code typed relations.

arisk commented 9 years ago

The views override should work just like in the example you posted. If you would like to use your own model you may do so by overriding the modelClass attribute of the Setttings component. If you want to use your own mvc all together you can simply import the component in your code without settings up the module. Just make sure you're implementing SettingInterface for your model so the component works properly.