aboutsummaryrefslogtreecommitdiffstats
path: root/Zotlabs/Web
diff options
context:
space:
mode:
authorredmatrix <git@macgirvin.com>2016-04-17 19:55:36 -0700
committerredmatrix <git@macgirvin.com>2016-04-17 19:55:36 -0700
commit966773cdbba80103e93290ccf01d0c91df5a000e (patch)
tree19499ed7c217fb801ec98086513d8b797103e37d /Zotlabs/Web
parentd2e61122c5aef942ea8160fabb4dbac72fb37caa (diff)
downloadvolse-hubzilla-966773cdbba80103e93290ccf01d0c91df5a000e.tar.gz
volse-hubzilla-966773cdbba80103e93290ccf01d0c91df5a000e.tar.bz2
volse-hubzilla-966773cdbba80103e93290ccf01d0c91df5a000e.zip
pull in the new object router and a few selected samples for the new controller layout
Diffstat (limited to 'Zotlabs/Web')
-rw-r--r--Zotlabs/Web/Router.php19
1 files changed, 14 insertions, 5 deletions
diff --git a/Zotlabs/Web/Router.php b/Zotlabs/Web/Router.php
index 6330efa17..6376f7697 100644
--- a/Zotlabs/Web/Router.php
+++ b/Zotlabs/Web/Router.php
@@ -14,14 +14,23 @@ class Router {
*
* We have already parsed the server path into App::$argc and App::$argv
*
- * App::$argv[0] is our module name. We will load the file mod/{App::$argv[0]}.php
+ * 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.
* The module file contains a few functions that we call in various circumstances
* and in the following order:
*
- * "module"_init
- * "module"_post (only called if there are $_POST variables)
- * "module"_content - the string return of this function contains our page body
+ * Object:
+ * class Foo extends Zotlabs\Web\Controller {
+ * function init() { init function }
+ * function post() { post function }
+ * function get() { nomral 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
@@ -160,7 +169,7 @@ class Router {
}
/**
- * Do all theme initialiasion here before calling any additional module functions.
+ * Do all theme initialisation here before calling any additional module functions.
* The module_init function may have changed the theme.
* Additionally any page with a Comanche template may alter the theme.
* So we'll check for those now.