Esempio n. 1
0
File: enum.php Progetto: vitch/sprig
 public function __construct(array $options = NULL)
 {
     parent::__construct($options);
     if (empty($this->choices)) {
         throw new Sprig_Exception('Enum fields must declare the available choices');
     }
 }
Esempio n. 2
0
 public function __construct(array $options = NULL)
 {
     if (empty($options['path']) or !is_dir($options['path'])) {
         throw new Sprig_Exception('Image fields must have a directory path to save and load images from');
     }
     parent::__construct($options);
     // Make sure the path has a trailing slash
     $this->path = rtrim(str_replace('\\', '/', $this->path), '/') . '/';
 }
Esempio n. 3
0
 public function __construct(array $options = NULL)
 {
     if (empty($options['directory']) or !is_dir($options['directory'])) {
         throw new Sprig_Exception('Image fields must define a directory path');
     }
     // Normalize the directory path
     $options['directory'] = rtrim(str_replace(array('\\', '/'), '/', $options['directory']), '/') . '/';
     parent::__construct($options);
 }
Esempio n. 4
0
 public function __construct(array $options = NULL)
 {
     parent::__construct($options);
     if ($this->empty or $this->prompt) {
         Arr::unshift($this->codes, '', $this->prompt);
     }
     if (!$this->choices) {
         $this->choices = $this->codes;
     }
 }