1 <?php
2
3 4 5 6 7 8 9 10
11
12 namespace Brickrouge;
13
14 class Salutation extends Element
15 {
16 public function __construct(array $tags=array(), $type=self::TYPE_RADIO_GROUP)
17 {
18 $options = array
19 (
20 'Misses',
21 'Miss',
22 'Mister'
23 );
24
25 array_walk($options, function(&$v) {
26
27 $v = t($v, array(), array('scope' => 'salutation'));
28
29 });
30
31 if ($type == 'select' && !empty($tags[self::REQUIRED]))
32 {
33 $options = array(null => '') + $options;
34 }
35
36 parent::__construct
37 (
38 $type, $tags + array
39 (
40 Form::LABEL => 'Salutation',
41 Element::OPTIONS => $options,
42
43 'class' => 'inline-inputs'
44 )
45 );
46 }
47 }