Search code examples
yiiyii-extensions

Can modules(extensions) be modified in Yii?


I am new to Yii framework, and just came across extensions provided by Yii. But I am confused whether we can modify the extension which are provided by Yii.

For example I am using Yii-user module, Now if I want to change the registration form provided by this module, So can I directly change it(by changing the files) ?
If - Yes: Will there be any problem while upgrading Yii version ?
If - No: How can be change it(May be from our custom file) ?


Solution

  • Yii is designed to build custom solutions, you should feel free to modify anything that is part of the generated 'site' including extensions and everything in the protected folder. However, conforming to the psyche and standards of coding used in Yii is certainly a good practice to benefit fully from the framework and you can only get into a habit of doing that after developing and re-developing with Yii over a period of time.

    Upgrading Yii version updates files in the framework directory only so its safe to make changes in your site part.

    You cannot upgrade that individual extension if you modify them directly(as now you have your own custom version). extending an extension as suggested by Cherif is a good option if you want to keep upgrade-ability for the extensions (protected/extensions).