Example #1
0
 /**
  * Final Cloneable field constructor with Decorator and ValidationExtender adding.
  *
  * @param string $name
  * @param null $attributes
  */
 public final function __construct($name, $attributes = null)
 {
     parent::__construct($name, $attributes);
     $templatePath = implode(DIRECTORY_SEPARATOR, [dirname(__FILE__), 'Cloneable', 'views', '']);
     $this->setDecorator(new Decorator($templatePath));
     $this->getDecorator()->setTemplateName('jquery');
     $this->addValidator(new ValidationExtender(array('cloneable' => $this)));
 }
Example #2
0
 /**
  * \Phalcon\Forms\Element constructor
  *
  * @param string $name
  * @param object|array|null $options
  * @param array|null $attributes
  * @throws Exception
  */
 public function __construct($name, $options = null, $attributes = null)
 {
     if (is_object($options) === false && is_array($options) === false && is_null($options) === false) {
         throw new Exception('Invalid parameter type.');
     }
     $this->_optionsValues = $options;
     parent::__construct($name, $attributes);
 }
Example #3
0
 public function __construct($name, $attributes = null)
 {
     parent::__construct($name, $attributes);
     $di = \Phalcon\Di::getDefault();
     $config = $di->get('config');
     $apis_config = $config->apis->toArray();
     if (empty($apis_config) || !isset($apis_config['recaptcha'])) {
         throw new \DF\Exception('Recaptcha is not configured in apis.conf.php!');
     }
     $this->config = $apis_config['recaptcha'];
 }
Example #4
0
 public function __construct($name, $options = array(), $attributes = null)
 {
     parent::__construct($name, $attributes);
     $this->_inner_form = new \Phalcon\Forms\Form();
     $this->_field_options = (array) $options;
     foreach ($this->_field_options as $check_key => $check_val) {
         $field_options = array('name' => $name . '[]', 'value' => $check_key);
         $element = new \Phalcon\Forms\Element\Check($name . '_' . $check_key, $field_options);
         $element->setLabel($check_val);
         $this->_inner_form->add($element);
     }
 }
Example #5
0
 public function __construct($name, $attributes = NULL, $icon = NULL)
 {
     $this->_icon = $icon;
     $this->_name = $name;
     if (!$attributes) {
         $attributes = [];
     }
     if (!isset($attributes['type'])) {
         $attributes['type'] = 'submit';
     }
     parent::__construct($name, $attributes);
 }
Example #6
0
 public function __construct($name)
 {
     parent::__construct($name);
     $this->path = 'files/';
     $this->name = $name;
     $this->maxFiles = 1;
     $this->uploadUrl = '/upload';
     $this->minFileSize = '1B';
     $this->maxFileSize = '10MB';
     $this->browserLabel = 'Select file';
     $this->browserType = self::BROWSER_BUTTON;
     $this->allowedExtensions = [];
     $this->forbiddenExtensions = [];
     $this->allowedMimeTypes = [];
     $this->forbiddenMimeTypes = [];
 }
 public function __construct($name, array $attributes = null)
 {
     parent::__construct($name, $attributes);
 }
Example #8
0
 public function __construct($name, $markup = null, $attributes = null)
 {
     parent::__construct($name, $attributes);
     $this->markup = $markup;
 }
Example #9
0
 public function __construct($name, $options = array(), $attributes = null)
 {
     parent::__construct($name, $attributes);
     $this->_inner_form = new \Phalcon\Forms\Form();
     $this->_field_options = (array) $options;
 }