public function alpha(array $options) {
        if (!$options['regex'])
            $options['regex'] = ($options['acceptSpace']) ? '/[^a-zA-Z\s]/' : '/[^a-zA-Z]/';
        if (!preg_match($options['regex'], $this->elementData))
            return true;

        $this->addError($this->checkMessage('Value can only contain alphabets', $options));
        return false;
    }
public function alpha(array $options) {
        if (!$options['regex'])
            $options['regex'] = ($options['acceptSpace']) ? '/[^a-zA-Z\s]/' : '/[^a-zA-Z]/';
        if (!preg_match($options['regex'], $this->elementData))
            return true;

        $this->addError($this->checkMessage('Value can only contain alphabets', $options));
        return false;
    }
public function alpha ( array $ options ) { if ( ! $ options [ 'regex' ] ) $ options [ 'regex' ] = ( $ options [ 'acceptSpace' ] ) ? '/[^a-zA-Z\s]/' : '/[^a-zA-Z]/' ; if ( ! preg_match ( $ options [ 'regex' ] , $ this -> elementData ) ) return true ; $ this -> addError ( $ this -> checkMessage ( 'Value can only contain alphabets' , $ options ) ) ; return false ; }
Checks if the contents of the element are all alphabets
@param string $name Name of the element to filter
@param  array $options Keys may include [message]
@return boolean
Checks if the contents of the element are all alphabets