Hello,
I am experiencing a strange behavior. I have the following code:
public function sendEventReportAction()
{
$events = Event::find([
"status = :status:",
"bind" => [
"status" => Event::STATUS_SETTLED
],
"order" => "end_time ASC"
]);
if ($events->count() > 0) {
foreach ($events as $o_event) {
$template = $this->renderEventTemplate($o_event);
ld($template);
}
}
}
private function renderEventTemplate(Event $o_event)
{
$this->view->pick('event/partial/status_content');
$this->view->setVar('o_event', $o_event);
$template = $this->view->getRender('event', 'status', null, function($view) {
$view->setRenderLevel(Phalcon\Mvc\View::LEVEL_ACTION_VIEW);
});
return $template;
}
This code it's a task that renders a template and sends it via email as html format. The problem that I have is that the view is rendering only the first event.
The rest of them are not rendered. So if i have 3 events, the $template var for event 1 returns the expected result, but for events 2 and 3 returns an empty string.
Anyone had similar problems ? Thanks.
Phalcon 1.3.4 / PHP 5.6 / Ubuntu 14.04