PHP Classes

How to make model

Recommend this page to a friend!

      MVC 4 Dummies  >  All threads  >  How to make model  >  (Un) Subscribe thread alerts  
Subject:How to make model
Summary:How to make model
Date:2015-04-02 04:04:58


  1. How to make model   Reply   Report abuse  
Picture of danidani danidani - 2015-04-02 04:04:58
How to make model and display all database data in view


  2. Re: How to make model   Reply   Report abuse  
Picture of Ali Sharifi 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
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
class HomeController extends BaseController
public function index(){
$users = User::all();