We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

selectStatic php notice

I have a line in .volt file :

{{ select_static('job-cat', job_cat, 'using': ['id', 'name'], 'useEmpty': true, 'emptyText': '', 'class': 'form-control') }}

it's compiled to (line 16):

<?php echo $this->tag->selectStatic(array('job-cat', $job_cat, 'using' => array('id', 'name'), 'useEmpty' => true, 'emptyText' => '', 'class' => 'form-control')); ?>

In php log file I see the following notice:

Notice: Array to string conversion in /Users/IGonza/git/xxx/app/cache/_users_xxxxx_app_views_job_add.volt.php on line 16

I'm not sure where it's coming from... What's wrong with the code?



58.4k

It not support, you try select

{{ select('job-cat', job-cat, 'using': ['id', 'name'], 'useEmpty': true, 'emptyText': '', 'class': 'form-control') }}


10.7k

If it's not supported.. why does it work? I just get weird notice. Select element is in html result



10.7k
<?php echo $this->tag->select(array('job-cat', $job_cat, 'using' => array('id', 'name'), 'useEmpty' => true, 'emptyText' => '', 'class' => 'form-control')); ?>

Notice: Array to string conversion in /Users/IGonza/git/xxx/app/cache/_users_igonza_git_xxx_app_views_job_add.volt.php on line 16



10.7k

There is no notice if I use :

'using': 'name'

And it generates :


<select id="job-cat" name="job-cat" class="form-control" using="name">

Is this a bug of 2.0.0 version?