开发者

Symfony: Can a component skip rendering the partial?

开发者 https://www.devze.com 2023-02-13 22:28 出处:网络
In my view I always want to call a component, but the component sometimes doesn\'t have to render anything.

In my view I always want to call a component, but the component sometimes doesn't have to render anything.

Is it possible in this situation to tell symfony to skip rendering the partial?

Renderin开发者_StackOverflowg an empty partial feels a bit ugly...


When the component doesn't have to render anything, just return sfView::NONE; in the component function.

You could skip using partials and use include_component instead...

0

精彩评论

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