开发者

Symfony: Overload helpers?

I'd like to overload the include_http_metas() helper (from the AssetHelper class) in order to make it HTML5 compliant.

Any ideas?

Much th开发者_运维百科anks.


Just copy the AssetHelper.php file (there is no class AssetHelper class at all) in the lib/helper directory of your app, and make your changes in the copy.

Source : http://www.symfony-project.org/book/1_2/07-Inside-the-View-Layer (§ Adding your own helpers)


I'm not sure what exactly you want to do but as include_http_metas() calls sfContext::getInstance()->getResponse()->getHttpMetas() you could use your own response class (defined in your factories.yml config) and use your own getHttpMetas() there.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜