We have already parsed the server path into App::$argc and App::$argv
App::$argv[0] is our module name. Let's call it 'foo'. We will load the Zotlabs/Module/Foo.php (object) or file mod/foo.php (procedural) and use it for handling our URL request to 'https://ourgreatwebsite.something/foo' . The module file contains a few functions that we call in various circumstances and in the following order:
Object:
function init() { init function }
function post() { post function }
function get() { normal page function }
}
Procedual interface:
foo_init()
foo_post() (only called
if there are $_POST variables)
foo_content() - the string return of this function contains our page body
Modules which emit other serialisations besides HTML (XML,JSON, etc.) should do so within the module init and/or post functions and then invoke killme() to terminate further processing.