Пример #1
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->subPath = 'View' . DS . 'Elements' . DS . 'modules' . DS;
     $this->validate = array('name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a name for this module'))), 'config' => array('validateJson' => array('rule' => 'validateJson', 'allowEmpty' => true, 'message' => __('Please enter a valid json config or leave blank'))), 'group_id' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please select the group this module is for'))), 'position_id' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please select the position this module will show in'))), 'author' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the author of this module'))), 'url' => array('notEmpty' => array('rule' => array('url', true), 'message' => __('Please enter the url of this module'))));
 }
Пример #2
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('name' => array('validName' => array('rule' => '/[a-z0-9_]{1,50}/', 'message' => __('Please enter a valid name, lowercase letters, numbers and underscores only')), 'isUnique' => array('rule' => 'isUnique', 'message' => __('There is already a position with that name'))));
 }