How do I add a value-ess attribute to the form tag?
I want to have:
<form data-abide >
according to: http://foundation.zurb.com/sites/docs/abide.html
I've tried
<?php $form = ActiveForm::begin(['id' => 'contact-form', 'options'=>['data-abide'=>'']]); ?>
but get output:
<form data-abide="ak8hvf-abide" >
Try this:
'options'=>['data-abide'=>true]
Reference: In the framework helper BaseHtml.php file, find :
function renderTagAttributes
Where :
foreach ($attributes as $name => $value) {if (is_bool($value)) { if ($value) { $html .= " $name"; } } elseif...
...
elseif ($value !== null) { $html .= " $name=\"" . static::encode($value) . '"'; }
...
It is actually behaving as expected - turns out it is the adide.js which adds the extra security token:
https://github.com/yiisoft/yii2/issues/10532#issuecomment-169952232
Thanks everyone for help!
For me, both 'data-abide'=>''
and 'data-abide'=>true
works fine...
Could it be something outdated? Can you try run a composer update
in your project?