Reputation: 3074
I am using CakePHP 3. I would like to generate my own style input tag. My code is:
<?php
echo $this->Form->input(
'rpassword', array(
'class' => 'form-control placeholder-no-fix',
'type' => 'password',
'autocomplete' => 'off',
'placeholder' => 'Re-type Your New Password'
)
);
?>
It generates HTML as follows:
<input name="data[Reseller][rpassword]" class="form-control placeholder-no-fix " autocomplete="off" placeholder="Re-type Your New Password" type="password" id="ResellerRpassword" >
But I want to set name attribute as 'rpassword' only. My expected HTML is:
<input name="rpassword" class="form-control placeholder-no-fix " autocomplete="off" placeholder="Re-type Your New Password" type="password" id="ResellerRpassword" >
Is there any way to do this?
Upvotes: 0
Views: 320
Reputation: 8540
You can set the name
attribute in the input
parameters like 'name' => 'rpassword'
:-
echo $this->Form->input(
'rpassword', array(
'class' => 'form-control placeholder-no-fix',
'type' => 'password',
'name' => 'rpassword',
'autocomplete' => 'off',
'placeholder' => 'Re-type Your New Password'
)
);
Upvotes: 1