PHP code example of zutto / pandora-mvc
1. Go to this page and download the library: Download zutto/pandora-mvc library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
zutto / pandora-mvc example snippets
PageDispatcher::registerLoader( $your_autoloader_for_controllers );
PageDispatcher::registerLoader( $your_autoloader_for_models );
EnvironmentFactory::setConfigFile(dirname(__FILE__)."/conf/environment.json");
FrontController::render(DEFAULT_PAGE, DEFAULT_ACTION);
class TimeController {
protected $request;
public function __construct( Request $request ) {
$this->request = $request;
}
public function format() {
$fmt = $this->request->get('format', 'You must specify a date format');
return array (
'timestamp' => date($fmt)
);
}
}