A
A
Ann20162016-06-24 00:58:06
Yii
Ann2016, 2016-06-24 00:58:06

How to change the files that are in the vendor?

It is necessary to change the layout and some logic in the comments extension, how to do it properly?
https://github.com/yeesoft/yii2-comments

Answer the question

In order to leave comments, you need to log in

3 answer(s)
P
Pavel Alexandrov, 2016-06-24
@inblank

Layout can be changed via themes:
www.yiiframework.com/doc-2.0/guide-output-theming.html
Controllers via controllerMap:
www.yiiframework.com/doc-2.0/yii-base-module.html#...
With models will be more difficult. The extension does not use dependency injection, therefore, as already mentioned, its own fork with all the consequences.

A
Andrey Klyuev, 2016-06-24
@BBird

The contents of the vendor folder cannot be touched, they are ruled by the composer.
Your task is not uncommon. Take the repository and fork it for yourself, make any edits and change the extension connection in composer.json accordingly. But you need to understand that in this case you lose extension updates in the future.

A
Andrew, 2016-06-24
@R0dger

Isn't it possible to inherit from the current class and change what you need?
or as suggested by Andrey Klyuev

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question