Good practice for module development
Hello, Is there any good practice advises for developing modules? *.module file gets too long. I would like to put form definitions to one file, block definitions to another. Regards, Ktt
First and foremost, leverage the menu system's lazy-loading capabilities: http://drupal.org/node/146172 That won't work for everything, but it will work for page callbacks. The theme system has a parallel design. --Larry Garfield ktt wrote:
Hello,
Is there any good practice advises for developing modules? *.module file gets too long. I would like to put form definitions to one file, block definitions to another.
Regards, Ktt
For one you can move any hook_menu page callbacks into seperate files and the menu system will load the file dynamically if you pass the $item definition the file parameter. You can also use module_load_include() to load outside files that are needed for specific functions. ----- Adam A. Gregory Drupal Developer & Consultant Web: AdamAGregory.com Twitter: twitter.com/adamgregory Phone: 910.808.1717 Cell: 706.761.7375 On Thu, Feb 4, 2010 at 2:50 PM, ktt <kestutis98@yahoo.com> wrote:
Hello,
Is there any good practice advises for developing modules? *.module file gets too long. I would like to put form definitions to one file, block definitions to another.
Regards, Ktt
participants (3)
-
Adam Gregory -
ktt -
larry@garfieldtech.com