i want to use different objects inside the template. different objects are created on different section of the site.
currently my code is
public function notify ($template, $info)
{
ob_start();
include $template;
$content = ob_get_clean();
//... more further code
}
as you see $info parameter. i dont want to use $info inside templates, but i was to use $photo, $admin or whatever is passed to it.
which i use like
// for feed
$user->notify('email_template_feed.php', $feed);
// for new photo - i would also like to use $user inside templates
$user->notify('email_template_photo.php', $photo);
how can i do that? cant use global, because is inside function and function is getting called dynamically on different locations/sections of the site, which can further extend.