mtoolkit / mtoolkit-controller
The controller module of MToolkit framework
Installs: 49
Dependents: 2
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 1
pkg:composer/mtoolkit/mtoolkit-controller
Requires
- php: >=5.3.0
- mtoolkit/mtoolkit-core: 0.0.2
- querypath/querypath: >=3.0.0
Requires (Dev)
- phpunit/phpunit: 5.1.*
This package is not auto-updated.
Last update: 2025-09-27 23:52:28 UTC
README
The controller module of MToolkit framework.
Summary
How a controller works
MPageController
MPageController is an autorun controller for the web pages.
Controller (Index.php):
<?php require_once __DIR__ . '/Settings.php'; use \MToolkit\Controller\MPageController; class Index extends MAbstractPageController { private $masterPage; public function __construct() { parent::__construct(__DIR__.'/Index.view'); } public function helloWorld() { return "Hello World"; } }
And the view file. Every view file must contain the meta tag, with the correct content-type:
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
Index.view:
<?php /* @var $this Index */ ?> <html> <head> <title>Entry page</title> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> </head> <body> <b><?php echo $this->helloWorld(); ?></b> </body> </html>
And now you can create your web app.
Handler
Routing
View Life Cycle
- Construct
- Init
- Load
- Pre render
- Render
- Post render