Created
October 21, 2011 06:42
-
-
Save nexeck/1303249 to your computer and use it in GitHub Desktop.
formo view select with disabled attribute for readonly
This file contains hidden or 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 $open; ?> | |
| <label<?php if ($id = $this->attr('id')) echo ' for="'.$id.'"'; ?>> | |
| <?php echo $label; ?> | |
| <span class="field"> | |
| <?php if ($this->editable() === TRUE): ?> | |
| <?php echo $this->open(); ?> | |
| <?php else: ?> | |
| <?php $this->attr('disabled', 'disabled'); ?> | |
| <?php echo $this->open(); ?> | |
| <?php endif; ?> | |
| <?php foreach ($this->_field->get('options') as $key => $value): ?> | |
| <?php if (is_array($value)): ?> | |
| <optgroup label="<?php echo $key?>"> | |
| <?php foreach ($value as $_key => $_value): ?> | |
| <option<?php echo HTML::attributes($this->get_option_attr('select', $_key))?>><?php echo $this->option_label($_value)?></option> | |
| <?php endforeach; ?> | |
| </optgroup> | |
| <?php else: ?> | |
| <option<?php echo HTML::attributes($this->get_option_attr('select', $key))?>><?php echo $this->option_label($value)?></option> | |
| <?php endif; ?> | |
| <?php endforeach; ?> | |
| <?php echo $this->close(); ?> | |
| </span> | |
| </label> | |
| <?php echo $message; ?> | |
| <?php echo $close; ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment