Correction modele + comment

This commit is contained in:
xdrm-brackets 2016-02-05 09:18:01 +01:00
parent fcf190a852
commit 05e4a31fe1
2 changed files with 13 additions and 7 deletions

View File

@ -76,7 +76,7 @@
$requete = new manager\ModuleRequest('userDefaultModule/getAll');
$answer = $requete->dispatch();
// var_dump( $answer->serialize() );
var_dump( \manager\ManagerError::explicit($answer->error) );
var_dump( $answer->get('users') );
return true;
@ -100,12 +100,12 @@
// Creation de la requete
$request = new \manager\ModuleRequest('firstModule/getUsers');
$answer = $request->dispatch();
// Debug error
var_dump( $request->error );
var_dump( \manager\ManagerError::explicit($request->error) );
var_dump( $answer->error );
var_dump( \manager\ManagerError::explicit($answer->error) );
$users = $request->dispatch()->get('users');
$users = $answer->get('users');

View File

@ -56,15 +56,21 @@
// On recupere tous les utilisateurs
debug();
$request = new \manager\ModuleRequest('userDefaultModule/getAll');
$answer = $request->dispatch();
$request = new \manager\ModuleRequest('userDefaultModule/getAll'); // On utilise la methode 'getAll' du module 'userDefaultModule'
$answer = $request->dispatch(); // On recupere la reponse
echo '<section>';
echo 'Liste des utilisateurs: <br>';
// si erreur, on affiche l'explicitation
if( $answer->error != \manager\ManagerError::Success )
var_dump( \manager\ManagerError::explicit($answer->error) );
// Si aucune erreur, on affiche les resultats
else
var_dump( $answer->get('users') );
echo '</section>';
}