1
votes

I was following this tutorial describing how to create pages with symfony. Everything was doing well till the method indexAction returned a basic Response object containing the html code.

Then I want to try the twig template engine, I change the "hello" by another word in the template in order to see the difference.

And when I reload the page, no change shown, as if the indexAction method of the controller still return the previous Response object...

I've tried to clear the cache, restart the apache server but it changes nothing. I've strictly followed the steps described in the tutorial (extension of the class Symfony\Bundle\FrameworkBundle\Controller\Controller etc...)

Do you have any idea of what could be the reasons of this problem?

1
Make sure the cache was really cleared. The right permissions are hard to set up. If rm -rf app/cache makes this work, then you have a permission problem.greg0ire
I made a rm -rf app/cache, then it throws "RuntimeException: Unable to create the cache directory (/home/victorinox/applications/web_apps/OpenRoadBook/www/app/cache/dev)". That mean the write permissions are not correctly set up I guess ? I followed the instructions in order to set the write permission with setfacl though.renard
Yes, but since you just removed the cache directory, I think the permissions were wiped out too.greg0ire
double-check that the template you're editing is in the right bundle...yitznewton
Well, I sorted it out by regenerating the bundle and all coming with it. I didn't found out explanations. Useless post sorry.renard

1 Answers

2
votes

After you made any changes and you want to see them in dev environment you can:

  1. Clear cache: php app/console cache:clear --env=dev
  2. Warmup cache: php app/console cache:warmup --env=dev

If you want to see changes in prod environment, you have only one option

  1. Warmup cache: php app/console cache:warmup --env=prod

If you will attempt to open any page after you cleared cache in prod, you will have HTTP 500 error of some kind or just blank page.

Sometimes, you have to manually empty app/cache folder.