Since PHPMaker 9, I decided not to customize 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 extension, 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 separate 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 extension. 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 can only extend only few the existing extension.
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. So please read the following articles for more information:
- Login Welcome Page (an authentication as a registered user is required)
- Step by Step to Implement Masino Extensions in a New Project of PHPMaker 10
- Step by Step How to Implement Masino Extensions in a New Project of PHPMaker 9.2.0