What happens is that I only pass a parameter from my view to the model where the method is for example:
* VIEW:
<h1> <?php foreach($this->modelo->Listar(2) as $r):?>
<?php echo $r->contenido ;?>
<?php endforeach;?>
</h1>
"List" is the name of my method that is in the model
* MODEL:
public function Listar($id){
try{
$query = $this->v->prepare("SELECT * FROM parrafo WHERE id_parrafo=?");
$query->execute(array($id));
return $query->fetch(PDO::FETCH_OBJ);
}catch(Exception $e){
die($e->getMessage());
}
}
I want to pass the parameter of the view to the model and it is assigned in the following of "?"
I hope to give you to understand is my first question on this site.