I have strang issue, fetched data using model, passed to view but view is always giving error :
Notice: Undefined property: Phalcon\Mvc\Model\Resultset\Simple::$id in D:\phalcon\cache\volt\d__server_www_phalcon3_ph_app_views_track_track.volt.php on line 17
I have following code: In controller :
if ($this->request->isPost()) {
if ($form->isValid($this->request->getPost()) == false) {
foreach ($form->getMessages() as $message) {
$this->flash->error($message);
}
return $this->dispatcher->forward([
"action" => "index"
]);
} else {
$issue = Issues::find(
[
'conditions' => 'idDisplay = :idDisplay:',
'bind' => [
'idDisplay' => $this->request->getPost('idDisplay', 'striptags'),
]
]
);
if (count($issue)==0 ) {
$this->flash->error("No Issue records found with given ID");
return $this->dispatcher->forward([
'action' => 'index'
]);
}
$this->view->issues = $issues;
}
In volt / view
<div class="card card-body">
{{ issue.id }}
</div>
Vardump for $issues->toArrary()
array (size=1)
0 =>
array (size=7)
'id' => string '30' (length=2)
'idDisplay' => string 'SOU08-180625-4434' (length=17)
'idUnitType' => string '5' (length=1)
'idUnits' => string '7' (length=1)
'idUsers' => string '11' (length=2)
'date' => string '1529916274' (length=10)
'description' => string '' (length=0)
And Error I am seeing everytime
Notice: Undefined property: Phalcon\Mvc\Model\Resultset\Simple::$id in D:\phalcon\cache\volt\d__server_www_phalcon3_ph_app_views_track_track.volt.php on line 17
It is same error for other properties too.