Пример #1
0
 /**
  * @copydoc AppModel::__construct()
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the name of this template')), 'isUnique' => array('rule' => 'isUnique', 'message' => __('There is already a template with that name'))), 'html' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please create the html for your template'))), 'plugin' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please select the plugin that this layout is for'))), 'model' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please select the model that this layout is for'))));
     $this->findMethods['autoLoadLayout'] = true;
     $this->findMethods['layoutList'] = true;
 }
Пример #2
0
 /** 
  * @copydoc AppModel::__construct()
  */
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->order = array($this->alias . '.lft' => 'asc');
     $this->findMethods['getCategory'] = true;
     $this->findMethods['categoryList'] = true;
 }
Пример #3
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('title' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a name for this content item'))), 'layout_id' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please select the layout for this content item'))), 'body' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter the body of this content item'))));
 }
Пример #4
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->_schema = array('file_name' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'primary'), 'slug' => array('type' => 'string', 'null' => false, 'default' => null, 'length' => 255), 'name' => array('type' => 'string', 'null' => false, 'default' => null, 'key' => 'unique'), 'body' => array('type' => 'text', 'null' => false, 'default' => '', 'length' => null));
     $this->validate = array('file_name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __d('contents', 'Please enter a filename for this item')), 'isUnique' => array('rule' => 'isUnique', 'message' => __d('contents', 'The page name must be unique'), 'on' => 'create'), 'validFileName' => array('rule' => '/^[A-Za-z0-9_]*\\.ctp$/', 'message' => __d('contents', 'The filename can only be alphanumeric or _ (underscore)'))), 'body' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __d('contents', 'The page can not be empty'))));
 }
Пример #5
0
 public function __construct($id = false, $table = null, $ds = null)
 {
     parent::__construct($id, $table, $ds);
     $this->validate = array('name' => array('notEmpty' => array('rule' => 'notEmpty', 'message' => __('Please enter a tag'))), 'keyname' => array('rule' => 'notEmpty', 'message' => __('Please enter the key name')));
 }