开发者

Using symfony layouts outside of view

I want to create a custom ./config/unavailable.php page using the layouts and styling used by the rest of my applic开发者_如何学运维ation. I could just copy the generated HTML that one of these pages renders, but then if I ever change the layout or style I would have to re-copy.

How can I render the unavailable.php page the same way I render the views?

I am using symfony 1.4.


unavailable.php is called when symfony is busy clearing its cache. You might want not to disturb it too much at this moment, that's why plain php is used. Copying html could be done by a cron task though, so if I were you I would try to combine cron, wget and sed to achieve this.


I'd suggest keeping it as manual HTML, a simple page. Whatever you need to do to copy over layouts/templates (which contain stuff that Symfony needs to execute to generate) isn't worth unless you plan having your app unavailable for most of the time. It's just easier to copy things over manually if you ever decide to make big CSS changes.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜