Best practice for location of module functions?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Best practice for location of module functions?

Post by calguy1000 »

1) split your install/upgrade/uninstall into method.xxxxxx.php
2) split your actions into action.xxxxxx.php
3) split your events into event.xxxxxx.php
4) I split my admin tabs into seperate files using function.admin_tab_xxxxx.php or something like that
5) then I try to use classes
    when I found that I'm going to be re-using those classes or functions I created an addon module for just that stuff CGExtensions
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
calguy1000
Support Guru
Support Guru
Posts: 8169
Joined: Tue Oct 19, 2004 6:44 pm
Location: Fernie British Columbia, Canada

Re: Best practice for location of module functions?

Post by calguy1000 »

I think the best module to look at would be Questions, it's pretty clean and well organized.

Typically though, I don't call one action from another, I use redirects to hande the flow. 
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Post Reply

Return to “Developers Discussion”