Since PHPMaker 9, I decided not to customize PHPMaker Template anymore. So I created Masino Extensions instead. Why? The main reason for this is: Customizing the Template needs much effort than creating the Extensions. In addition, creating the Masino Extensions is easier for me to follow the changes and implementing the updates that released by PHPMaker into my Extensions.
Creating the Extensions in PHPMaker needs more specific attention, and of course: a smart logic. Let's say I have to handle the possibilities of user will enable some Extensions that have the similar functionality. I also have to handle the possibilities of intersection between one Extension and anothers.
Separate into some smaller Extensions
As we have already known, MasinoCAPTCHA10 Extension is the replacement of CAPTCHA Extension that located under the CAPTCHA Type. So, I have to think smart before creating it and make sure MasinoCAPTCHA10 Extension will be placed also under the same CAPTCHA. Why? Simple answer: to avoid collision. Long answer: Imagine if I put MasinoCAPTCHA10 Extension in the different type, then user will be able to enable both Extensions, and this will affect to unwated result in the generated web applications.
The similar thing also for my another Extensions: MasinoPreviewRow10 to replace Preview extension, MasinoHorizontalVertical10 to replace HorizontalMenu, MasinoFixedWidthSite10 to replace ScrollingTable, and so forth.
I have to put both the similar extension in the same type, so that user will have to decide and choose before enabling it. This is important for you to know before asking me such question: "Why don't you put all of them in one .zip file?". In other words, if I have to put all of them into one .zip file, then I should customize the template (something that I avoid from now on), and not creating the Extensions.
In addition, by separating the Extensions become some smaller Extension files, will make me easier and quicker while updating them to the latest version of PHPMaker. Moreover, you can also extend my existing Extensions by creating your own Extensions that best suit with your needs, and put it also under the same type in order to avoid the clashing between one and another. This is one of so many advantages of using Extensions instead of customizing the template.
Dependencies with another Masino Extensions
Since I could not combine all of my Extensions into one zip file, then there will be also the possibility of some of my Extensions will depends on the other my Extensions. For example, in order to implement MasinoLogin10, MasinoChangePwd10, MasinoForgotPwd10, and MasinoRegister10 Extensions, then you need to enable MasinoCustomCSS10 Extension, too.
The main reason for this, since those Extensions will use the same custom CSS that defined in MasinoCustomCSS10. That would be better if I put all the same or similar code and functionalities in one Extension, and then use this Extension as the prerequisites for the other Extensions.
This is also something that I cannot avoid. So, please try to understand this considerations and reasons.
Intersection on overriding the same template file
Another important thing that you need to know is, some of my Extensions will use the same template file with my another Extensions. For example, they need to customize or override the code in phpcommon-scripts.php template file. This will cause me to update all of my Extensions that use that file if I change or customize the code in my Extensions, so that the generated web applications will work properly.
That's why also you will see, for the certain cases, I have to update all the related Extensions that overriding the same template file. I cannot only update one Extension and leave the other, since this will cause unwanted results in the generated web applications.
In other words, there is always the possibilities some Extensions have the intersection with other Extensions, and this is something that we cannot avoid, too.
Why do I have to enable all of Masino Extensions?
Short answer: To optimize your generated web applications. Long answer: Masino Extensions was created in the beginning to replace the template customization. As the main reason why I choose creating the Extensions instead of customizing template above, there is also another important reason why you have to enable all of Masino Extensions. Some of my Extensions have dependencies with another.
Next question: Can I only use or enable only one or few of Masino Extensions? The answer is, even there are few Extensions that do not have the dependencies with another, for some cases you will get an error while generating the script files using PHPMaker if you do not enable all of Masino Extensions.
See? So, again, it is always recommended to enable all of Masino Extensions to overcome the error issue while generating, and to optimize your generated web applications completely.
If you think you can override Masino Extensions with yours, then it's fine, you may create your Extensions by yourself based on my existing Extensions. However, please again, try to obey the rule in PHPMaker, such as put the similar Extensions in the same Type of it, as well as I have explained above. In other words, you should only extend few the existing Extensions.
See? This is another advantages of creating and using Extensions in PHPMaker instead of customizing the Template.
So, what next?
Always follow the instructions that suggested and related to its PHPMaker version before implementing Masino Extensions into your PHPMaker project. Download Masino Extensions and PHPMaker Project files that related to your PHPMaker version. I suggest you to always play with the Project files that I shared in order to know the recommended Extention settings that should be used in your PHPMaker project. If you hesitate or have some difficulties to implement Masino Extensions into your PHPMaker project, then always refer to the related demo project file or new project file (starter kit project), that I always share both of them, with each version of Masino Extensions. Don't forget also to always read and follow the instructions from README.txt file before trying it.
Good luck and Enjoy!
Excellent explanation…