Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

Special behavior of Select Element if named "year"

Hi

i found a starange behaviour of Phalcon\Forms\Element\Select

using name "year" i get an error "Object of class DateTime could not be converted to string".

$yearSelect = new \Phalcon\Forms\Element\Select('year',["2015"=>"2015","2016"=>"2016"]);
echo $yearSelect;

Using any other name than "year", the code works as expected.

Bug or undocumented feature?



33.6k
Accepted
answer
edited Sep '15

Are you passing variables from the controller? Using Tag::setDefault ? Maybe they get converted to string causing the exception



2.0k

*doh* ... missing the forrest for the trees ^

my fault, sorry