Last active
December 11, 2015 16:59
-
-
Save eduardoromero/4631636 to your computer and use it in GitHub Desktop.
Foundation -> Cake Input dissected.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php echo $this->Form->create('Cliente', array('id' => 'empresa-add', 'class' => 'custom', 'inputDefaults' => array('div' => false, 'label' => false, 'class' => '', 'error' => array('wrap' => 'small', 'class' => '')))); ?> | |
<div class="row"> | |
<?php $input_error = $this->Form->isFieldError('telefono') ? 'error': ''; ?> | |
<div class="six columns <?php echo $input_error ?>"> | |
<?php echo $this->Form->input('telefono', array('type' => 'text', 'placeholder' => 'Teléfono', 'class' => '')); ?> | |
</div> | |
<?php $input_error = $this->Form->isFieldError('contacto') ? 'error': ''; ?> | |
<div class="six columns <?php echo $input_error ?>"> | |
<?php echo $this->Form->input('estado', array('contacto' => 'text', 'placeholder' => 'Contacto', 'class' => '')); ?> | |
</div> | |
</div> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
We disable divs and labels and add Foundation's row + cols divs and define how the errors are going to be wrapped:
Is used to add an error class to the div that holds the input. Marking it as with error in a way that the User can easily identify.