How can I show the label to the left of the form control and not above?
CSS and/or Customizing the Templates FormHelper Uses.
That’s the question, how do I change the css for the label in the creation of the form control? I am creating the control with this code: $this->Form->control('profile_id', ['label' => 'Perfil', 'labelOptions' => ['class' => 'left'], 'options' => $profiles, 'empty' => '- Seleccione un perfil -', 'id' => 'profile_id'])
and is not putting the attribute class=“left” in the label, how can I solve this issue?
That’s a much better formulation of the question. You’ve shown what you tried, and have a specific thing that you think should be working ('class' => 'left'
), but it’s not. Far easier for people to solve for you than “How do I…” I don’t have an answer for you right at this moment, but nevertheless…
Yes, you are right, sorry, I broke the creation of the form control in two parts, in one part I create the label with $this->Form->label('profile_id', 'Perfil', ['class' => 'left'])
and in the other I create a select control with $this->Form->select('profile_id', $profiles, ['empty' => '- Seleccione un perfil -', 'id' => 'profile_id'])
and now it adds the class=“left” attribute, thank you nevertheless