Hoa central
Button.php
Go to the documentation of this file.
1 <?php
2 
37 namespace Hoa\Xyl\Interpreter\Html;
38 
47 class Button extends GenericPhrasing
48 {
54  protected static $_attributes = [
55  'autofocus' => parent::ATTRIBUTE_TYPE_NORMAL,
56  'async' => parent::ATTRIBUTE_TYPE_NORMAL,
57  'asyncaction' => parent::ATTRIBUTE_TYPE_LINK,
58  'asyncenctype' => parent::ATTRIBUTE_TYPE_NORMAL,
59  'asyncmethod' => parent::ATTRIBUTE_TYPE_NORMAL,
60  'asynctarget' => parent::ATTRIBUTE_TYPE_NORMAL,
61  'asyncscope' => parent::ATTRIBUTE_TYPE_NORMAL,
62  'disabled' => parent::ATTRIBUTE_TYPE_NORMAL,
63  'form' => parent::ATTRIBUTE_TYPE_NORMAL,
64  'formaction' => parent::ATTRIBUTE_TYPE_LINK,
65  'formenctype' => parent::ATTRIBUTE_TYPE_NORMAL,
66  'formmethod' => parent::ATTRIBUTE_TYPE_NORMAL,
67  'formnovalidate' => parent::ATTRIBUTE_TYPE_NORMAL,
68  'formtarget' => parent::ATTRIBUTE_TYPE_NORMAL,
69  'name' => parent::ATTRIBUTE_TYPE_NORMAL,
70  'type' => parent::ATTRIBUTE_TYPE_NORMAL,
71  'value' => parent::ATTRIBUTE_TYPE_NORMAL
72  ];
73 
79  protected static $_attributesMapping = [
80  'autofocus',
81  'async' => 'data-async',
82  'asyncaction' => 'data-asyncaction',
83  'asyncenctype' => 'data-asyncenctype',
84  'asyncmethod' => 'data-asyncmethod',
85  'asynctarget' => 'data-asynctarget',
86  'asyncscope' => 'data-asyncscope',
87  'disabled',
88  'form',
89  'formaction',
90  'formenctype',
91  'formmethod',
92  'formnovalidate',
93  'formtarget',
94  'name',
95  'type',
96  'value'
97  ];
98 
105  protected $_contentFlow = 2;
106 
112  protected $_validity = null;
113 
114 
115 
121  public function getForm()
122  {
123  return Form::getMe($this);
124  }
125 
133  public function isValid($revalid = false, $value)
134  {
135  if (false === $revalid && null !== $this->_validity) {
136  return $this->_validity;
137  }
138 
139  $this->_validity = $value === $this->readAttribute('value');
140 
141  return Form::postValidation($this->_validity, $value, $this);
142  }
143 
150  public function setValue($value)
151  {
152  $this->writeAttribute('value', $value);
153 
154  return;
155  }
156 }
isValid($revalid=false, $value)
Definition: Button.php:133
static getMe(Concrete $element)
Definition: Form.php:592
static postValidation($verdict, &$value, Concrete $element, $postVerification=true)
Definition: Form.php:447