Answer the question
In order to leave comments, you need to log in
How to output phalcon+volt array?
So I give it to the volt array
class IndexController extends ControllerBase
{
public function indexAction()
{
$robots = $this->db->fetchAll(
"SELECT * FROM goods",
\Phalcon\Db::FETCH_ASSOC
);
$this->view->products = $robots;
}
{% for product in products %}
{{ product.name }}
{% endfor %}
{{dump(product)}}
Notice: Trying to get property of non-object in D:\Soft\OpenServer\OpenServer\domains\cas.dev\app\cache\d__soft_openserver_openserver_domains_cas.dev_app_views_index_index.volt.php on line 3
array(4) { ["id"]=> string(1) "1" ["cat_id"]=> string(1) "1" ["name"]=> string(3) "asg" ["descr"]=> string(3) "gas" }
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question