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 ^^