phpMv  -UI toolkit 2.4.12
jQuery, jQuery UI, Twitter Bootstrap and Semantic-UI library for php & php MVC Frameworks
State.php
Go to the documentation of this file.
1 <?php
2 
4 
7 
8 abstract class State extends BaseEnum {
9  const ACTIVE="active", DISABLED="disabled", ERROR="error", FOCUS="focus", LOADING="loading", NEGATIVE="negative", POSITIVE="positive", SUCCESS="success", WARNING="warning";
10 
11  public static function add($state, $elements) {
12  if (!\is_array($state)) {
13  $state=\explode(" ", $state);
14  }
15  if (\is_array($elements)) {
16  foreach ( $elements as $element ) {
17  if ($element instanceof BaseHtml) {
18  self::_add($state, $element);
19  }
20  }
21  }
22  }
23 
24  private static function _add($states, $element) {
25  foreach ( $states as $state ) {
26  $element->addToPropertyCtrl("class", $state, array ($state ));
27  }
28  }
29 }
static _add($states, $element)
Definition: State.php:24
BaseHtml for HTML components.
Definition: BaseHtml.php:17
Base class for enums see at http://stackoverflow.com/questions/254514/php-and-enumerations.
Definition: BaseEnum.php:11
static add($state, $elements)
Definition: State.php:11