[2.0.0] Phalcon\Tag::select() can not work with 'using' option in Volt
Following code in Volt can not work using 2.0.0. (with 1.3.4 it works)
{{ select('productId', products, 'using': ['id', 'name'], 'useEmpty': true, 'emptyText': 'Please, choose one...', 'emptyValue': '@') }}
http://docs.phalconphp.com/en/latest/reference/tags.html#making-select-boxes
Thanks,
Are you getting an error or something?
I can't find any massage on error log (Even the setting of error_reporting = E_ALL on php.ini).
Actually, the select form is shown on 2.0.0, however the second and third options (the value of "products" and "'using': ['id', 'name']" as following example code) don't work, then the select form options has empty names and values.
{{ select('productId', products, 'using': ['id', 'name'], 'useEmpty': true, 'emptyText': 'Please, choose one...', 'emptyValue': '@') }}
If use in model 'colums' \Model\Categories::find(array( 'columns' => array( 'id', 'name', 'url_name', ), 'order' => 'name ASC',)); not work. select form options has empty names and values.
if use with out 'colums' \Model\Categories::find(array('order' => 'name ASC')); - all work correct
I have the same issue, but in my case, my products entity is a doctrine entity.
Hello I am experiencing the same issue, posted my experience with it at this Thread -- #10284 No errors being reported - Just blank select being formed.
I'm not able to reproduce this, could you please try again using latest Phalcon 2 (2.0.3) or submit a script that allow us to see the problem?
Thank you for your comment. I find another cause of this problem of code on controller.
If i used following code on controller, the problem does not occur.
$products = Products::find();
However, if I use "columns" option on find() as follows, phalcon v2.0.3 returns blank select form.
$products = Products::find(array(
'columns' => array(
'id', 'name'
)
));
Fixed in Phalcon 2.0.4