diff options
Diffstat (limited to 'Zotlabs/Web/SubModule.php')
-rw-r--r-- | Zotlabs/Web/SubModule.php | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/Zotlabs/Web/SubModule.php b/Zotlabs/Web/SubModule.php new file mode 100644 index 000000000..122766d5a --- /dev/null +++ b/Zotlabs/Web/SubModule.php @@ -0,0 +1,31 @@ +<?php + +namespace Zotlabs\Web; + + +class SubModule { + + private $controller = false; + + function __construct() { + + if(argc() < 2) + return; + + $filename = 'Zotlabs/Module/' . ucfirst(argv(0)) . '/'. ucfirst(argv(1)) . '.php'; + $modname = '\\Zotlabs\\Module\\' . ucfirst(argv(0)) . '\\' . ucfirst(argv(1)); + if(file_exists($filename)) { + $this->controller = new $modname(); + } + } + + function call($method) { + if(! $this->controller) + return false; + if(method_exists($this->controller,$method)) + return $this->controller->$method(); + return false; + } + +} + |