multi user
This commit is contained in:
@ -12,20 +12,47 @@ class HomeController extends AbstractController
|
||||
public function home()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$categorys = $em->getRepository("App:Category")->findAll();
|
||||
$links = $em->getRepository("App:Link")->findAll();
|
||||
$webzines = $em->getRepository("App:Webzine")->findBy([], ['set' => 'ASC', 'order' => 'ASC']);
|
||||
|
||||
$users = $em->getRepository("App:User")->findBy([],["pseudo"=>"ASC"]);
|
||||
$categorys = $em->getRepository("App:Category")->findBy(["user"=>null]);
|
||||
$links = $em->getRepository("App:Link")->findBy(["user"=>null]);
|
||||
$webzines = $em->getRepository("App:Webzine")->findBy(["user"=>null], ['set' => 'ASC', 'order' => 'ASC']);
|
||||
|
||||
return $this->render('Home/home.html.twig',[
|
||||
"useheader" => false,
|
||||
"usesidebar" => false,
|
||||
"usemonocolor" => true,
|
||||
"users" => $users,
|
||||
"categorys" => $categorys,
|
||||
"links" => $links,
|
||||
"webzines" => $webzines
|
||||
]);
|
||||
}
|
||||
|
||||
public function user($userpseudo)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$user=$em->getRepository("App:User")->findOneBy(["slug"=>$userpseudo]);
|
||||
if(!$user) return $this->redirectToRoute("app_home");
|
||||
|
||||
$categorys = $em->getRepository("App:Category")->findBy(["user"=>$user]);
|
||||
$links = $em->getRepository("App:Link")->findBy(["user"=>$user]);
|
||||
$webzines = $em->getRepository("App:Webzine")->findBy(["user"=>$user], ['set' => 'ASC', 'order' => 'ASC']);
|
||||
$config = $em->getRepository("App:Config")->getUserConfig($user);
|
||||
|
||||
return $this->render('Home/user.html.twig',[
|
||||
"useheader" => false,
|
||||
"usesidebar" => false,
|
||||
"usemonocolor" => true,
|
||||
"user" => $user,
|
||||
"config" => $config,
|
||||
"categorys" => $categorys,
|
||||
"links" => $links,
|
||||
"webzines" => $webzines
|
||||
]);
|
||||
}
|
||||
|
||||
|
||||
public function feed($nb)
|
||||
{
|
||||
$feeds=[];
|
||||
|
Reference in New Issue
Block a user