Hoa central
Public Member Functions | Protected Attributes | Static Protected Attributes | List of all members
Hoa\Xyl\Interpreter\Html\Select Class Reference
Inheritance diagram for Hoa\Xyl\Interpreter\Html\Select:

Public Member Functions

 getOptions ()
 
 getSelectedOptions ()
 
 getForm ()
 
 isValid ($revalid=false, $value)
 
 setValue ($value)
 
- Public Member Functions inherited from Hoa\File\Generic
 getBasename ()
 
 getDirname ()
 
 getSize ()
 
 getStatistic ()
 
 getATime ()
 
 getCTime ()
 
 getMTime ()
 
 getGroup ()
 
 getOwner ()
 
 getPermissions ()
 
 getReadablePermissions ()
 
 isReadable ()
 
 isWritable ()
 
 isExecutable ()
 
 clearStatisticCache ()
 
 touch ($time=-1, $atime=-1)
 
 copy ($to, $force=Stream\IStream\Touchable::DO_NOT_OVERWRITE)
 
 move ($name, $force=Stream\IStream\Touchable::DO_NOT_OVERWRITE, $mkdir=Stream\IStream\Touchable::DO_NOT_MAKE_DIRECTORY)
 
 delete ()
 
 changeGroup ($group)
 
 changeMode ($mode)
 
 changeOwner ($user)
 
 isFile ()
 
 isLink ()
 
 isDirectory ()
 
 isSocket ()
 
 isFIFOPipe ()
 
 isCharacterSpecial ()
 
 isBlockSpecial ()
 
 isUnknown ()
 
 getMode ()
 
 getINode ()
 
 getRealPath ()
 
 getExtension ()
 
 getFilename ()
 
- Public Member Functions inherited from Hoa\Stream\Stream
 __construct ($streamName, $context=null, $wait=false)
 
 open ()
 
 close ()
 
 getStreamName ()
 
 getStreamContext ()
 
 _setStream ($stream)
 
 isOpened ()
 
 setStreamTimeout ($seconds, $microseconds=0)
 
 setStreamBlocking ($mode)
 
 setStreamBuffer ($buffer)
 
 disableStreamBuffer ()
 
 getStreamBufferSize ()
 
 getStreamWrapperName ()
 
 getStreamMetaData ()
 
 isBorrowing ()
 
 on ($listenerId, $callable)
 
 _notify ($ncode, $severity, $message, $code, $transferred, $max)
 
 __toString ()
 
 __destruct ()
 

Protected Attributes

 $_validity = null
 
- Protected Attributes inherited from Hoa\File\Generic
 $_mode = null
 
- Protected Attributes inherited from Hoa\Stream\Stream
 $_bucket = []
 
 $_bufferSize = 8192
 
 $_streamName = null
 
 $_context = null
 
 $_hasBeenDiffered = false
 
 $_on = null
 
 $_borrowed = false
 

Static Protected Attributes

static $_attributes
 
static $_attributesMapping = …
 

Additional Inherited Members

- Static Public Member Functions inherited from Hoa\File\Generic
static clearAllStatisticCaches ()
 
static umask ($umask=null)
 
static isCaseSensitive ()
 
- Static Public Member Functions inherited from Hoa\Stream\Stream
static getStreamHandler ($streamName)
 
static _Hoa_Stream ()
 
- Public Attributes inherited from Hoa\Stream\Stream
const NAME = 0
 
const HANDLER = 1
 
const RESOURCE = 2
 
const CONTEXT = 3
 
- Public Attributes inherited from Hoa\Stream\IStream\Statable
const SIZE_UNDEFINED = -1
 
- Public Attributes inherited from Hoa\Stream\IStream\Touchable
const OVERWRITE = true
 
const DO_NOT_OVERWRITE = false
 
const MAKE_DIRECTORY = true
 
const DO_NOT_MAKE_DIRECTORY = false
 
- Protected Member Functions inherited from Hoa\File\Generic
 setMode ($mode)
 
- Protected Member Functions inherited from Hoa\Stream\Stream
_open ($streamName, Context $context=null)
 
 _close ()
 
 getStream ()
 

Detailed Description

Class .

The <select> component.

Definition at line 47 of file Select.php.

Member Function Documentation

Hoa\Xyl\Interpreter\Html\Select::getForm ( )

Get form.

Returns

Definition at line 105 of file Select.php.

106  {
107  return Form::getMe($this);
108  }
static getMe(Concrete $element)
Definition: Form.php:592

Here is the call graph for this function:

Hoa\Xyl\Interpreter\Html\Select::getOptions ( )

Get all <option> components.

Returns
array

Definition at line 85 of file Select.php.

86  {
87  return $this->xpath('.//__current_ns:option');
88  }

Here is the caller graph for this function:

Hoa\Xyl\Interpreter\Html\Select::getSelectedOptions ( )

Get the selected <option> components.

Returns
array

Definition at line 95 of file Select.php.

96  {
97  return $this->xpath('.//__current_ns:option[@selected]');
98  }
Hoa\Xyl\Interpreter\Html\Select::isValid (   $revalid = false,
  $value 
)

Whether the input is valid or not.

Parameters
bool$revalidRe-valid or not.
mixed$valueValue to test.
Returns
bool

Definition at line 117 of file Select.php.

118  {
119  if (false === $revalid && null !== $this->_validity) {
120  return $this->_validity;
121  }
122 
123  $this->_validity = true;
124 
125  if ((null === $value || '' === $value || [] === $value) &&
126  true === $this->attributeExists('required')) {
127  $this->_validity = false;
128 
129  return Form::postValidation($this->_validity, $value, $this);
130  }
131 
132  if (empty($value)) {
133  $this->_validity = true;
134 
135  return Form::postValidation($this->_validity, $value, $this);
136  }
137 
138  if (is_array($value)) {
139  if (false === $this->attributeExists('multiple')) {
140  $this->_validity = false;
141 
142  return Form::postValidation($this->_validity, $value, $this);
143  }
144  } else {
145  $value = [$value];
146  }
147 
148  foreach ($this->getOptions() as $option) {
149  $option = $this->getConcreteElement($option);
150 
151  if (false === $option->attributeExists('value')) {
152  continue;
153  }
154 
155  $handle = $option->readAttribute('value');
156 
157  if (false !== $i = array_search($handle, $value)) {
158  unset($value[$i]);
159  }
160  }
161 
162  $this->_validity = empty($value);
163 
164  return Form::postValidation($this->_validity, $value, $this);
165  }
static postValidation($verdict, &$value, Concrete $element, $postVerification=true)
Definition: Form.php:447

Here is the call graph for this function:

Hoa\Xyl\Interpreter\Html\Select::setValue (   $value)

Set value.

Parameters
mixed$valueValue.
Returns
string

Definition at line 173 of file Select.php.

174  {
175  foreach ($this->getOptions() as $option) {
176  $option = $this->getConcreteElement($option);
177 
178  if (false === $option->attributeExists('value')) {
179  continue;
180  }
181 
182  if ($value !== $option->readAttribute('value')) {
183  continue;
184  }
185 
186  $option->writeAttribute('selected', 'selected');
187  }
188 
189  return;
190  }

Here is the call graph for this function:

Member Data Documentation

Hoa\Xyl\Interpreter\Html\Select::$_attributes
staticprotected
Initial value:
= [
'autofocus' => parent::ATTRIBUTE_TYPE_NORMAL

Definition at line 54 of file Select.php.

Hoa\Xyl\Interpreter\Html\Select::$_attributesMapping = …
staticprotected

Definition at line 69 of file Select.php.

Hoa\Xyl\Interpreter\Html\Select::$_validity = null
protected

Definition at line 76 of file Select.php.


The documentation for this class was generated from the following file: