K
K
kosuha2016-08-07 20:20:56
Yii
kosuha, 2016-08-07 20:20:56

Yii2 Customization of extensions, how to customize your view for someone else's extension?

Hello! I have a seemingly simple question, but I could not find anything on the Internet in response to it ...
Question: How to customize ready-made extensions from other developers in yii2 ???
Usually, if I did something on yii2 before, I did everything from scratch, but this time I decided that I needed to use the ready-made code of other developers, but the problem immediately appeared that I didn’t know how, for example, for some ready-made controller some extension to assign its own view so as not to make changes to the sources of this extension .. so that you can easily execute composer update and receive new updates without erasing your changes ...
I hope I clearly stated the problems... How to customize the extension, as for example it can be done in Bitrix (customization of components) or in Joomla! (customization of themes, etc.)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
kosuha, 2016-08-07
@kosuha

I’ll answer my own question, but if someone wants to add something, I won’t mind ...
Apparently, it’s enough to make your own controller, for example app\controllers\ProfileController and inherit it from the desired controller from the extension, therefore the new controller will receive all methods of the extension controller, but at the same time it will look for views in the views / profile folder, this is basically what you need !!! here .., but this is of course if the extension controller uses non-absolute paths to connect view files ... and if absolute, I think you can come up with some kind of behavior to handle this problem, but I think this happens rarely ..

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question