You see, I am currently testing a new program for web page development called Symfony, for which I use the Codeanywhere server. I am trying to make a simple web page in which I pass a sentence as an argument to a view.
This is the code:
Obviously, this message does not tell me anything, so I would like to know what I did wrong. By the way, I use version 3. I know that currently the current version is 4, but the tutorials I follow are from version 2, and that would distance me too much.
Edit: I currently have this view:
<center>
<h1>
¡Vamos! ¿Queréis ganar o no?
</h1>
</center>
And I modified the indexAction function to use it:
public function indexAction(Request $request){
// replace this example code with whatever you need
return $this->render('default/nuevo.html.twig');
}
And this really works for me. That is, the failure is not in the view or in the return. It has to be in the web address. I have also tried this:
/**
* @Route("/entrena", name="homepage")
*/
public function indexAction(Request $request){
// replace this example code with whatever you need
return $this->render('default/index.html.twig'
,['base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'),]);
}
And this if it fails.
More information: I have visited the var / logs folder, where I have the error reports. In it 2 files have caught my attention. The first one is "dev.log", in which I have seen this error message:
[2018-10-01 08:37:48] request.INFO: Matched route "_wdt". {"route_parameters":{"_controller":"web_profiler.controller.profiler:toolbarAction","token":"c867c1","_route":"_wdt"},"request_uri":"http://empresa-algarroba78565438.codeanyapp.com/web/app_dev.php/_wdt/c867c1"} []
The second one is "prod.log", in which the most recent error message is as follows:
[2018-10-01 08:40:07] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "No route found for "GET /entrena"" at /home/cabox/workspace/var/cache/prod/classes.php line 2383 {"exception":"[object] (Symfony\Component\HttpKernel\Exception\NotFoundHttpException(code: 0): No route found for \"GET /entrena\" at /home/cabox/workspace/var/cache/prod/classes.php:2383, Symfony\Component\Routing\Exception\ResourceNotFoundException(code: 0): at /home/cabox/workspace/var/cache/prod/appProdUrlMatcher.php:44)"} []
Does anyone know what each mistake means?