Error using span in Cakephp

Asked

Viewed 22 times

0

As attached image I can’t use span when I step to the Cake pattern. Can anyone help me, pfv.

<div class='col-md-12'>
  <div class="input-group" >
    <!-- Span Bootstrap -->
    <span class="input-group-addon" id="email1">E-mail:</span>
      <input type="text" class="form-control" id="basic-url" aria-describedby="email1">
    </div>
    <!-- Fim Span com Bootstrap -->
    <!-- Span Bootstrap no padrão CakePHP -->
    <div class="input-group" >
      <?php  echo $this->Form->input('email', ['type' => 'text', 'class' => 'input-group-addon', 
              'aria-describedby' => 'email', 'span' => ['class' => 'input-group-addon', 'id'=> 'email', 'text' => 'E-mail']
              ]); ?>
    </div>
    <!-- Span Bootstrap no padrão CakePHP -->
</div>

Print attached below

inserir a descrição da imagem aqui

  • What the HTML generated by cake looks like?

  • The result in HTML?

  • Now it looks like this. https://gist.github.com/FabricioDev/6e18cb38daf4df202f75de778c7c2762

  • <div class="input-group" > <span class="input-group-addon" id="email">E-mail:</span> <div class="input text required"><label for="email"></label><input type="text" name="email" class="input-group-addon" Aria-describedby="email" required="required" maxlength="50" id="email" value="[email protected]"/></div>

  • I think you’ll need to change the template, which you should be adding to the div. Check it out: https://book.cakephp.org/3.0/en/views/helpers/form.html#customizing-the-templates-formhelper-uses

  • I do not know how to do this but I found that it is because of the asterism of required. I will try to align the right.

Show 1 more comment
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.