/
textarea.php
31 lines (23 loc) · 1.08 KB
/
textarea.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<!-- BEGIN YForm_Textarea Element -->
<div class="yform-item yform-textarea<?php echo empty($errors) ? '' : ' has-errors'; ?>" id="<?php echo Arr::get($attributes, 'id'); ?>-container">
<?php if ( ! empty($label)): ?>
<label for="<?php echo Arr::get($attributes, 'id'); ?>" >
<?php echo $label; ?>
<?php if ($object->get('required') !== FALSE): ?>
<span class="required"><?php echo ($object->required === TRUE)?'*':$object->required; ?></span>
<?php endif; ?>
</label>
<?php endif; ?>
<textarea <?php echo HTML::attributes($attributes); ?>><?php echo HTML::chars($object->value); ?></textarea>
<?php foreach ($messages as $type => $array): ?>
<?php if ($type !== 'errors'): // We want errors last ?>
<?php foreach ($array as $message): ?>
<div class="message <?php echo $type; ?>"><?php echo $message; ?></div>
<?php endforeach; ?>
<?php endif; ?>
<?php endforeach; ?>
<?php foreach (Arr::get($messages, 'errors', array()) as $error): ?>
<div class="message error"><?php echo $error; ?></div>
<?php endforeach; ?>
</div>
<!-- END YForm_Textarea Element -->