O
O
O_Nayre2018-04-28 23:41:07
Laravel
O_Nayre, 2018-04-28 23:41:07

Form Radio Button glitch, which server setting is responsible for handling variables in the template engine?

From some moment I catch a strange glitch:
with the standard syntax

{{ Form::radio('somename', 'someval', true, ['adparam'=>'someparam']) }}

the checked parameter does not work on the local host (mac, vagrant/box, laravel 5.4), but it works on a remote server... I've
already broken my head in which direction to dig, because I didn't even notice the moment when the function fell off (the fact that it worked until some point - a fact)?
UPD:
After dancing with a tambourine, it turned out that servers process values ​​differently.
For localhost it works:
{!! Form::radio('sex', 0, true) !!}
{!! Form::radio('sex', 1) !!}
{!! Form::radio('sex', 2) !!}

for production server:
{!! Form::radio('sex', '0', true) !!}
{!! Form::radio('sex', '1') !!}
{!! Form::radio('sex', '2') !!}

The question is, where is the variable handling parameter (etc 1!='1') hidden?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
O_Nayre, 2018-05-02
@O_Nayre

The problem was in different versions of PDO drivers and, accordingly, different processing of int / num / str, a temporary crutch:

'mysql' => [
           ...
           'options'   => [PDO::ATTR_EMULATE_PREPARES => true]
],

Read more stackoverflow
Thanks to the Laracasts community.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question