T
T
tigra2016-06-10 17:40:12
JavaScript
tigra, 2016-06-10 17:40:12

What is the correct way to make changes in YII2 components?

I have a gridview component.
All js is in vendor/component/panel
There was a need to hang up some events. I corrected it directly in vendor.
The team leader says that you need to make separate js, and hang events on the trigger so that everyone does not edit this js in the vendor.
I would like to know where to take out this separate js and where to include it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
Maxim Timofeev, 2016-06-12
@tigroid3

If you need to extend the functions of gridview, then you need to write your own class, inherit it from gridview, so connect the necessary js through assets, etc.
Then there will be no problems when updating yii via composer.

R
Rou1997, 2016-06-10
@Rou1997

If changes (Utils / Helpers, etc.) were needed once, then they will be needed again, including in other projects, so if you understand how everything works, then a "fork" of the framework is not bad, but good, and the team leader is wrong, but since such a team leader, then do it right in the app, that is, outside the framework.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question