Nathan MVC Framework (ok)
https://github.com/dloewith/Nathan-MVC
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^([a-zA-Z]*)/?([a-zA-Z]*)?/?([a-zA-Z0-9]*)?/?$ index.php?controller=$1&action=$2&id=$3 [NC,L]Trang Home
<?php
/*
* Project: Nathan MVC
* File: /classes/basecontroller.php
* Purpose: abstract class from which controllers extend
* Author: Nathan Davison
*/
abstract class BaseController {
protected $urlValues;
protected $action;
protected $model;
protected $view;
public function __construct($action, $urlValues) {
$this->action = $action;
$this->urlValues = $urlValues;
//establish the view object
$this->view = new View(get_class($this), $action);
}
//executes the requested method
public function executeAction() {
return $this->{$this->action}();
}
}
?>
Trang Test

Previous=== START Very basic PHP MVC framework ===NextMột ví dụ đơn giản liên kiết với database (ok)
Last updated