jagguy
1
Hi,
How do I align where the form element box appears as I want each input box to start on the same column instead of after the label finishes.
echo $this->Form->input('first_name',['label' => 'Tutor FirstName']);
echo $this->Form->input('last_name',['label' => 'Tutor LastName']);
echo $this->Form->input('email', ['label' => 'Email']);
echo $this->Form->input('mobile', ['label' => 'Mobile']);
echo $this->Form->input('home_phone',['label' => 'Home Phone']);
echo $this->Form->input('work_phone',['label' => 'Work Phone']);
SATHISH
2
You can control form design in using form templates
$this->Form->templates([ ‘inputContainer’ => ‘
{{content}}
’, ]);
See here for reference
jagguy
3
I dont understand how this relates to my code and what I need to do. The docs shown wasn’t overly clear
$myTemplates = [
'inputContainer' => '<div class="form-control">{{content}}</div>',
];
$this->Form->templates($myTemplates);
Here you can customize your form div section and also add new class to label and input box.
jagguy
5
if I want to right align each form control what I am putting though? what goes in content , the css?
$myTemplates = [
‘inputContainer’ => ‘
{{content}}
’,
];
$this->Form->templates($myTemplates);
Forget all about cakephp for one second aligning elements has nothing to do with cake it has to do with HTML.