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:

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.



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();