has() public method

Checks if an attribute is defined.
public has ( string $name ) : boolean
$name string The attribute name
return boolean true if the attribute is defined, false otherwise
Beispiel #1
0
 private function generateCaptchaValue()
 {
     if (!$this->keepValue || !$this->session->has($this->key)) {
         $value = '';
         $chars = str_split($this->charset);
         for ($i = 0; $i < $this->length; $i++) {
             $value .= $chars[array_rand($chars)];
         }
         $this->session->set($this->key, $value);
     } else {
         $value = $this->session->get($this->key);
     }
     return $value;
 }