Answer the question
In order to leave comments, you need to log in
Where to raise the authorization of an MVC project?
First of all, I want to say thanks to Toaster and some stubborn users who answered half of my questions for several months - see frameworks.
I chose two for myself ... Yii2 and Laravel. Zend and Symfony have turned out to be heavy so far.
But the ultimate goal of my bike is to finish my offspring-monster.
Actually the question... With the help of some magic and one British hello-tubers, I made the admin authorization not through two lines in htaccess, but with the help of autoloaders and dozens of two classes... Well, okay - it will do... I made a mistake
in one thing - I I tested and wrote everything in the main controller. Now the task is to raise it up.
public function index()
{
if(Session::exists('success')){
echo Session::flash('success');
}
$user = new User();
if($user->isLoggedIn()){
$this->view->assign('user',$user);
echo $this->view->render('index');
}
else{
echo $this->view->render('login');
}
}
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