Jump to content

Polymorf

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Male
  • Location
    Paris

Polymorf's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. ok thank you! I understand the principle now! the tutorial that I found is good, but Kevin Waterson who have the author does not give an example with the class db! the link is : http://www.phpro.org/tutorials/Model-View-Controller-MVC.html he put a static instance of a global script init.php but I do not know how to retrieve the body from one of my classes model! he said the matter as follows in the file init.php $registry = new registry; $registry-> db = db:: getInstance (); Now how do I recover the body in a class model that I have? because I tried that and it does not work! in one method: public function getMessage() { // an exemple for my model $request = "SELECT * FROM messages"; $pdo = $registry->query($request); return $pdo->fetch(PDO::FETCH_OBJ); } I say that I repeat my class PDO but what keeps the singleton pattern and to review always a getInstance I apologize if my English is not good! I use google translate to help me! thank you fro your help ^^
  2. hello! I find this tutorial on the MVC he looks very interesting but I can not get too used to someone could help me? http://www.phpro.org/tutorials/Model-View-Controller-MVC.html#6 example: I would like to import a model that uses the database with PDP! and I do not know how or I can use the header (Location: ...) I started in OOP thank you for your help !
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.