public function __construct($name, $param = array()) { parent::__construct($name, $param); $this->model = isset($param['model']) ? $param['model'] : $name; $this->method = isset($param['method']) ? $param['method'] : $name; $this->opt = isset($param['opt']) ? $param['opt'] : new data(array()); if (isset($param['quant'])) { $this->quant = $param['quant']; } }
public function __construct($name, $param = array()) { parent::__construct($name, $param); if (!file_exists(PATH_ROOT . '/' . DIR_CACHE . '/captcha')) { mkdir(PATH_ROOT . '/' . DIR_CACHE . '/captcha'); chmod(PATH_ROOT . '/' . DIR_CACHE . '/captcha', 0777); } $opt = new data(array('font' => PATH_ROOT . '/' . DIR_LIBRARY . '/font/arial.ttf', 'imgDir' => PATH_ROOT . '/' . DIR_CACHE . '/captcha', 'imgUrl' => '/' . DIR_CACHE . '/captcha', 'wordlen' => 4, 'dotNoiseLevel' => 0, 'lineNoiseLevel' => 0, 'fsize' => 20, 'width' => 100, 'height' => 60)); if (isset($param['captcha'])) { $opt->set($param['captcha']); } $this->captcha = new Zend\Captcha\Image($opt->to_array()); $this->validator['captcha'] = array('captcha' => $this->captcha); }
public function __construct($name, $param = array()) { parent::__construct($name, $param); $this->model = isset($param['model']) ? $param['model'] : $name; $this->method = isset($param['method']) ? $param['method'] : $name; if (isset($param['quant'])) { $this->quant = $param['quant']; } if (!isset($param['ui'])) { $param['ui'] = new data(); } if (!isset($param['ui']->theme)) { $param['ui']->theme = 'base'; } if (!isset($param['ui']->opt)) { $param['ui']->opt = new data(array()); } $this->ui = $param['ui']; }