I'm trying to create login page, and i want just to test Doctrine if i'ts working or not but i faced this probleme with template's Location so this is my code
namespace Login\loginBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
class LoginController extends Controller
{
public function loginAction()
{
$username="username";
$password="password";
$em=$this->getDoctrine()->getEntityManager();
$repository=$em->getRepository('Login\loginBundle\Entity\Login\Utilisateur');
$user=$repository->findOneBy(array('username'=>$username,'password'=>$password));
if($user){
return $this->render('Login\loginBundle\Resources\views\Default\index.html.twig',array('name'=>$user->getNom()));
}
else{
return $this->render('Login\loginBundle\Resources\views\Default\index.html.twig',array('name'=>'login failed'));
}
}
This is the Location of my template Login\loginBundle\Resources\views\Default\index.html.twig
and this is the error i got :
Unable to find template "Login\loginBundle:Default:index.html.twig".
500 Internal Server Error - InvalidArgumentException
3 linked Exceptions:
Twig_Error_Loader »
InvalidArgumentException »
InvalidArgumentException »
[4/4] InvalidArgumentException: Unable to find template "Login\loginBundle:Default:index.html.twig". +
[3/4] Twig_Error_Loader: Unable to find template "Login\loginBundle:Default:index.html.twig". +
[2/4] InvalidArgumentException: Template name "Login/loginBundle:Default:index.html.twig" is not valid. +
[1/4] InvalidArgumentException: Bundle "Login/loginBundle" does not exist or it is not enabled. Maybe you forgot to add it in the registerBundles() method of your AppKernel.php file? +
thank for your help