Answer the question
In order to leave comments, you need to log in
Symfony 4: how to display a template on the main page?
Entered in terminal:
$ php bin/console make:controller DefaultController
// ...
class DefaultController extends Controller
{
/**
* @Route("/")
*/
public function new(Request $request)
{
// ...
return $this->render('default/new.html.twig', [
'default' => $default->createView(),
]);
}
}
// ...
/**
* @Route("/")
*/
public function new(Request $request)
{
// ...
return $this->render('base.html.twig', [
'default' => $default->createView(),
]);
}
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