/**
* @Assert\NotBlank()
* @ORM\Column(name="price", type="integer", length=11)
*/
public $price;
/**
* @Assert\Regex('/[\w ]+/u')
* @Assert\NotBlank()
* @ORM\Column(name="name", type="string", length=255)
*/
public $name;
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
</head>
<body>
{{ content() }}
</body>
</html>
// Get all robots
$robots = Robots::find();
// Traversing with a foreach
foreach ($robots as $robot) {
echo $robot->name, "\n";
}
{ [0]=> array(4) { ["id"]=> string(1) "1" ["cat_id"]=> string(1) "1" ["name"]=> string(3) "asg" ["descr"]=> string(3) "gas" } }
$this->view->products = Goods::find();
{% for product in products %} //
{{ product['name'] }} // не работает т.к передается весь обьект
{% endfor %} //
{{dump(products)}} // выводит весь обьект
{ [0]=> array(4) { ["id"]=> string(1) "1" ["cat_id"]=> string(1) "1" ["name"]=> string(3) "asg" ["descr"]=> string(3) "gas" } }
$this->view->products = Goods::find();