src/User/UserController.php
public function getPostEditUser()
    {
        $this->di->get("auth")->isLoggedIn();

        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("email", $this->di->get("session")->get("user"));

        $title      = "Redigera profil";
        $card       = "Redigera";
        $view       = $this->di->get("view");
        $pageRender = $this->di->get("pageRender");
        $form       = new EditUserForm($this->di, $user->email);

        $form->check();

        $data = [
            "form" => $form->getHTML(),
            "card" => $card,
            "title" => $title,
        ];

        $view->add("user/edit", $data);

        $pageRender->renderPage(["title" => $title]);
    }
public function getPostEditUser()
    {
        $this->di->get("auth")->isLoggedIn();

        $user = new User();
        $user->setDb($this->di->get("db"));
        $user->find("email", $this->di->get("session")->get("user"));

        $title      = "Redigera profil";
        $card       = "Redigera";
        $view       = $this->di->get("view");
        $pageRender = $this->di->get("pageRender");
        $form       = new EditUserForm($this->di, $user->email);

        $form->check();

        $data = [
            "form" => $form->getHTML(),
            "card" => $card,
            "title" => $title,
        ];

        $view->add("user/edit", $data);

        $pageRender->renderPage(["title" => $title]);
    }
public function getPostEditUser ( ) { $ this -> di -> get ( "auth" ) -> isLoggedIn ( ) ; $ user = new User ( ) ; $ user -> setDb ( $ this -> di -> get ( "db" ) ) ; $ user -> find ( "email" , $ this -> di -> get ( "session" ) -> get ( "user" ) ) ; $ title = "Redigera profil" ; $ card = "Redigera" ; $ view = $ this -> di -> get ( "view" ) ; $ pageRender = $ this -> di -> get ( "pageRender" ) ; $ form = new EditUserForm ( $ this -> di , $ user -> email ) ; $ form -> check ( ) ; $ data = [ "form" => $ form -> getHTML ( ) , "card" => $ card , "title" => $ title , ] ; $ view -> add ( "user/edit" , $ data ) ; $ pageRender -> renderPage ( [ "title" => $ title ] ) ; }
Handler with form to update a user.

@return void
Handler with form to update a user .