Answer the question
In order to leave comments, you need to log in
How to integrate PHPAuth into MVC project?
I started to study MVC and I can't figure out how to properly integrate https://github.com/PHPAuth/PHPAuth into the project. It is clear that you can do inside the view:
include 'languages/ru_RU.php';
include 'Config.php';
include 'Auth.php';
global $auth,$config;
$dbh = new PDO("mysql:host=localhost;dbname=crm", "crm", "pass");
$dbh->exec("set names utf8");
$config = new PHPAuth\Config($dbh);
$auth = new PHPAuth\Auth($dbh, $config, "ru_RU");
if ($auth->isLogged()){
$user = $auth->getUser( $auth->getSessionUID( $auth->getSessionHash() ) );
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question