Simple MVC PHP framework.
public static $HOST = 'host';
public static $USERNAME = 'username';
public static $PASSWORD = 'password';
public static $DB = 'database';
Edit connection.php according to the server setup.
class Data extends Model
{
protected $table = 'data';
}
Create model by extending Model class and put the table name accordingly.
class ViewController extends Controller
{
public function index()
{
View::render('index');
}
}
Create controller by extending Controller class and add function for a single route. (i.e 1 function for 1 route)
Create necessary views which can be rendered by the controller.
$route = array
(
'index' => 'ViewController/index',
'getlist' => 'DataController/getList',
'get' => 'DataController/get',
'add' => 'DataController/add',
'update' => 'DataController/update',
'delete' => 'DataController/delete',
);
Provide routes with the following format: ControllerClass/method.