Rene Koller
Rene Koller

Reputation: 415

How to pass Parameters to Partials and Components?

I'm pretty new to the Symfony Framework and currently searching for the Best-Practice way to pass Parameters from a search to the included partials.

Currently I'm checking for the Parameter in the executeSearch Method and then setting a variable that is available in the searchSuccess.php File.

In the searchSuccess.php File I'm simply passing the variable to the Partial in the include_partial Method in the array. I keep passing the variable around until I'm in the correct partial.

My Method seems to complicated and wrong, but it seems I can't access the sfRequest variables outside the executeSearch Method?

Upvotes: 0

Views: 424

Answers (1)

j0k
j0k

Reputation: 22756

You can access the request object in any template by calling $sf_request.

Upvotes: 1

Related Questions