Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Symfony default controller white page

Tags:

php

symfony

After installing a fresh version of symfony via composer

php composer create-project symfony/framework-standard-edition myProject

The default welcome page looks like thisenter image description here

All permissions are correct so not sure where the default view is? Anyone seen this before?

like image 431
joshuahornby10 Avatar asked Jan 03 '15 15:01

joshuahornby10


1 Answers

This is exactly what should be displayed. When you install the standard framework edition, it comes with a default AppBundle that has a controller which loads the default index page. The content of that template simply displays Homepage.

Here's the AppBundle/Controller/DefaultController call, it renders the default/index.html.twig template:

return $this->render('default/index.html.twig');

And here's the content section of that template:

{% block body %}
Homepage.
{% endblock %}

The fact that the Symfony profiler is showing at the bottom is the main indicator that you actually installed Symfony properly.

Here are the files in Symfony 2.7:

https://github.com/symfony/symfony-standard/blob/2.7/src/AppBundle/Controller/DefaultController.php https://github.com/symfony/symfony-standard/blob/2.7/app/Resources/views/default/index.html.twig

The screenshot you are looking for existed for the Acme/DemoBundle which was the default through Symfony 2.4, but this was removed in Symfony 2.5 in favor of a much more bare-bones AppBundle.

like image 66
Jason Roman Avatar answered Oct 15 '22 03:10

Jason Roman