
Ali Sharifi - 2015-04-02 21:16:06 -
In reply to message 1 from danidani
I dont make any BaseModel class that user could extend from the base model , but u can write ur model classes in the /model .
for example
<?php
Class User
{
public static function all(){
$users=DBHandler::getAll("SELECT password FROM users");
return $users;
}
}
and u can use this class methods in your controller to display the output in view like this
<?php
class HomeController extends BaseController
{
public function index(){
$users = User::all();
$this->templateEngine->assign('users',$users);
$this->templateEngine->display('home.tpl');
}
}