Reputation: 612
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
Reputation: 64
This way:
include_partial('moduleName/partialName', array(
'object1' => $Object1,
'object2' => $Object2
));
then in the partial use $object1, $object2 etc.
Upvotes: 3