We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

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