As I know, there is no specific template, but the question always arises:
- Why should I separate the logic of the module and the user interface from several modules? Is it really necessary?
This is only necessary if you have developed a module that can accept different user interfaces, such as views and simple views . IMO there is no other reason for this.
Well, believing that our module needs a thing _ui. Here I try to separate the main functions of the module and its configuration user interface as an example. Take a look at the Unfuddle API module , which is a pretty tiny and simple module that fits our case. Here $ tree ./unfuddle_api:
unfuddle_api/
|
|
|
|
|
|
0 directories, 6 files
! unfuddle_api.install , hook_uninstall(), , variable_del() . API, , .
IMO , unfuddle_api_ui.
unfuddle_api.classes.inc - API unfuddle, - , , .
. , variable_get() . .module.
unfuddle_api.module . hook_perm() hook_menu() unfuddle_api_create(), - a Factory Unfuddle, unfuddle_api.classes.inc.
_ui. variable_get() unfuddle_api.classes.inc, , unfuddle_api_create().
, : unfuddle_api, API Unfuddle. , . unfuddle_api_create() .
unfuddle_api_ui, unfuddle_api, , .
, .