BenCr
BenCr

Reputation: 6052

Symfony including javascript in one environment but not another,

I've got a really basic symfony site and I'm trying to display an OpenLayers map.

I've included the required javascript files in my view.yml file.

indexSuccess:
  javascripts: [OpenLayers.js, http://www.openstreetmap.org/openlayers/OpenStreetMap.js, http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js]

editSuccess:
  stylesheets: [form.css]

showSuccess:
  stylesheets: [show.css]

But my javascript files are only included when I access the site using the frontend_dev.php environment.

Also something in the dev environment is also including a CSS file which is 404ing. It's not included in the production environment and I'm not sure where it's coming from. It's a relative URI pointing to /js/theme/default/style.css. Although it might be something that the javascript is creating.

Any ideas?

Thanks Ben

Upvotes: 0

Views: 590

Answers (1)

richsage
richsage

Reputation: 27102

When you make changes to configuration files such as view.yml, running in dev mode automatically uses the latest version of your file. Running in production mode (or essentially, a non-dev mode) does not, and will use the compiled version from the cache. Simply run:

symfony cc

to clear the cache and subsequently use the latest version of the files for your non-dev mode.

Upvotes: 2

Related Questions