开发者

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 开发者_StackOverflow中文版set the analytics JS code as a slot in myActions::preExecute() and extend sfActions. Anyone have a better idea?

Many thanks!


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜