Formal\Element::option PHP 메소드

option() 공개 메소드

public option ( $sName )
    function option($sName)
    {
        if (array_key_exists($sName, $this->aOptions)) {
            return $this->aOptions[$sName];
        }
        throw new \Exception("\\Formal\\Element->option(): Option '" . htmlspecialchars($sName) . "' not found.");
    }

Usage Example

예제 #1
0
파일: Form.php 프로젝트: paulproteus/Baikal
 public function validateColor($sValue, \Formal\Form\Morphology $oMorpho, \Formal\Element $oElement)
 {
     if (!empty($sValue) && !preg_match("/^#[a-fA-F0-9]{6}([a-fA-F0-9]{2})?\$/", $sValue)) {
         return "<strong>" . $oElement->option("label") . "</strong> is not a valid color with format '#RRGGBB' or '#RRGGBBAA' in hexadecimal values.";
     }
     return TRUE;
 }
All Usage Examples Of Formal\Element::option