nyroFwk  0.2
captcha.class.php
Go to the documentation of this file.
1 <?php
10 class form_captcha extends form_text {
11 
12  protected function afterInit() {
13  if (!$this->label && !is_bool($this->label))
14  $this->label = ucfirst($this->name);
15  if (!is_object($this->cfg->value))
16  $this->cfg->value = utils::htmlOut($this->cfg->value);
17  $this->id = str_replace(
18  array('[]', '[', ']'),
19  array('_', '_', ''),
20  $this->name);
21  }
22 
23  public function getValid() {
24  return null;
25  }
26 
27  public function isValid() {
28  $ret = empty($this->cfg->value);
29  if (!$ret && $this->cfg->errorFct && is_callable($this->cfg->errorFct))
30  call_user_func($this->cfg->errorFct);
31  return $ret;
32  }
33 
34  public function getErrors() {
35  return $this->isValid()? array() : array($this->cfg->error);
36  }
37 
38  public function addRule($type, $prm=null) {}
39 
40 }
static htmlOut($val, $key=false)
addRule($type, $prm=null)
Generated on Sun Oct 15 2017 22:25:20 for nyroFwk by doxygen 1.8.13