WORK-APE
Paul LEVRAULT 1 year ago
parent 09dafc90c0
commit 1aa8dcc9fa

@ -3,13 +3,6 @@
namespace App\Controller;
namespace App\Controller;
use App\Container;
use App\Router\Request\IRequest;
use App\Router\Response\Response;
use Shared\Attributes\Route;
use Twig\Environment;
use Data\Core\Preferences;
use Shared\Log;
use App\Container;
use App\Router\Request\IRequest;
use App\Router\Response\Response;
@ -48,28 +41,30 @@ class AthleteController extends BaseController
'username' => 'alicesmith',
],
];
// if(!Validation::val_string($name)){
if(!Validation::val_string($username)){
print("Nom invalide.");
}
try {
//code...
// $model->userMgr->getUser($name);
return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => "Doe",
'role' => "Athlète",
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $utiliArray,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
$listUser=$this->container->get(UserManager::class)->searchItemsByName($username);
$currentUser=$this->container->get(UserManager::class)->getCurrentUser();
return $this->render('./page/addfriend.html.twig',[
'css' => $this->preference->getCookie(),
'pp' => "test2",
'user' => $currentUser->getUsername(),
'role' => $currentUser->getRole(),
'friendship' => [],
'analyzes' => [],
'mails' => [],
'users' => $listUser,
'infoUser' => [],
'exos' => [],
'member' => [],
'responce' => "Notification d'ajout envoyée à $username"
]);
} catch (\Throwable $th) {
//throw $th;
// return $this->render("addfriend.html.twig", ['tabError' => $taberror ]);
}
// }
}

Loading…
Cancel
Save