Beispiel #1
0
 /**
  * Установка правила на атрибуты
  */
 protected function rule()
 {
     $rule = parent::rule();
     $rule->arrays[0]['value'] = Rule::bool();
     return $rule;
 }
Beispiel #2
0
 /**
  * Правило на атрибуты
  * @return Rule
  */
 protected function rule()
 {
     return Rule::arrays(['name' => Rule::string()->regexp('|^[^/@:#\\\\]*$|')->min(IS_INSTALL ? 1 : 0)->max(100)->required(), 'parent' => Rule::any(Rule::uri(), Rule::null()), 'proto' => Rule::any(Rule::uri(), Rule::null()), 'author' => Rule::any(Rule::uri(), Rule::null()), 'order' => Rule::int()->max(Entity::MAX_ORDER), 'created' => Rule::int(), 'updated' => Rule::int(), 'value' => Rule::string()->max(65535), 'is_draft' => Rule::bool(), 'is_hidden' => Rule::bool(), 'is_mandatory' => Rule::bool(), 'is_property' => Rule::bool(), 'is_relative' => Rule::bool(), 'is_link' => Rule::bool(), 'is_default_value' => Rule::bool(), 'is_default_file' => Rule::bool(), 'is_default_logic' => Rule::bool(), 'file' => Rule::any([Rule::null(), Rule::string()->regexp('/[^\\/\\\\]+/ui'), Rule::arrays(['tmp_name' => Rule::string(), 'name' => Rule::lowercase()->ospatterns('*.*')->ignore('lowercase')->required(), 'size' => Rule::int(), 'error' => Rule::int()->eq(0, true), 'type' => Rule::string()])])]);
 }
Beispiel #3
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required(), 'agree' => Rule::bool()->default(false)->required(), 'path' => Rule::regexp('/^' . preg_quote($this->path->value(), '/') . '($|\\/)/ui')->required()])]);
 }
Beispiel #4
0
 function startRule()
 {
     return Rule::arrays(['REQUEST' => Rule::arrays(['form' => Rule::eq($this->uri())->default(false)->required(), 'email' => Rule::email()->default(false)->required(), 'password' => Rule::string()->default(false)->required(), 'remember-me' => Rule::bool()->default(false)->required(), 'path' => Rule::regexp('/^' . preg_quote($this->path->value(), '/') . '($|\\/)/ui')->required()]), 'COOKIE' => Rule::arrays(['token' => Rule::string()->max(32)->default(false)->required()])]);
 }