0

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?

Rendering an empty partial feels a bit ugly...

Jeroen
  • 3,271
  • 1
  • 20
  • 25

1 Answers1

4

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...

Jonas Wouters
  • 707
  • 1
  • 7
  • 22