CakePHP-Bootstrap / cakephp3-bootstrap-helpers

CakePHP 3.x Helpers for Bootstrap 3 and 4.
https://holt59.github.io/cakephp3-bootstrap-helpers/
MIT License
130 stars 79 forks source link

Multiple controls at same row #164

Closed vicmosin closed 5 years ago

vicmosin commented 5 years ago

Any chance to implement multiple controls within same row at forms (similar to https://getbootstrap.com/docs/4.1/components/forms/#form-row) with current version?

Holt59 commented 5 years ago

This is similar to #70 (old one... ) but with Bootstrap 4. I am currently lacking time to implement new features, but a quick workaround would be to alter the correct template:


// Update the inputContainer template.
$this->Form->setTemplate('inputContainer', '<div class="form-group col-md-6 {{type}}{{required}}">{{content}}</div>');

// Open the form-row div manually.
echo '<div class="form-row">';

// Output your controls:
echo $this->Form->control(...);
echo $this->Form->control(...);

echo '</div>';

// Reset the template
$this->Form->setTemplate('inputContainer', '<div class="form-group {{type}}{{required}}">{{content}}</div>');