Select option in Volt

Hi @all,

i have little problems to understand the docu of phalcon.

I want to create an select option and I am using volt for it.

In the docu I found this:

{{ select("type", productTypes, 'using': ['id', 'name']) }}

It is here:

https://docs.phalconphp.com/en/latest/reference/volt.html

Where do the id, name and productTypes comes from? Where do i create them? And how?

Sorry, but i am an absolutely beginner to phalcon.

Rgds

Stefan

You have to pass productTypes as a variable in the controller, id and name are attributes present in the model.

public function viewAction()
{
    $this->view->productTypes = ProductTypes::find();
}