Tanu Gupta
Tanu Gupta

Reputation: 612

Object passing in symfony 1.4 partial using include_partial()?

I want an object in my partial. I want to use object variables and functions in the partial. Is it possible to pass an object in include_partial() function? Or how can I access the object in partial? I dont want to set the object in symfony request.

Upvotes: 4

Views: 2824

Answers (1)

Aitor
Aitor

Reputation: 64

This way:

include_partial('moduleName/partialName', array(
  'object1' => $Object1, 
  'object2' => $Object2
));

then in the partial use $object1, $object2 etc.

Upvotes: 3

Related Questions