yitznewton
yitznewton

Reputation: 810

symfony view: share layout.php between apps, but with differences

I have several symfony apps (different vhosts) with the same skin, i.e. layout.php. I have one instance of the layout.php and asset files "someplace," and I symlink them into each app.

I would like to use Google Analytics with these apps, which requires each app to include its own key. How can I inject it into the layout.php?

Best answer I could come up with is to set the analytics JS code as a slot in myActions::preExecute() and extend sfActions. Anyone have a better idea?

Many thanks!

Upvotes: 1

Views: 285

Answers (1)

Jeremy Kauffman
Jeremy Kauffman

Reputation: 10413

Why not just use an sfConfig value to set the tracker id? Then the value can be configured in the app.yml file for each app.

Upvotes: 3

Related Questions