Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@cakephp-tutorial
Created February 27, 2016 14:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cakephp-tutorial/638974bf723d10cd5d2c to your computer and use it in GitHub Desktop.
Save cakephp-tutorial/638974bf723d10cd5d2c to your computer and use it in GitHub Desktop.
<?php
#/app/Model/Author.php
class Author extends AppModel {
public $name = 'Author';
public $displayField = 'name'
public $hasMany = array('Book');
public $validate = array(
'name' => array(
'rule' => array('notEmpty'),
'required' => true,
'allowEmpty' => false,
'message' => 'Inserire il Nome'
),
'surname' => array(
'rule' => array('notEmpty'),
'required' => true,
'allowEmpty' => false,
'message' => 'Inserire Cognome'
),
'email' => array(
'mail' => array(
'rule' => 'email',
'allowEmpty' => false,
'required' => true,
'message' => 'Inserire un indirizzo email valido'
),
'vuoto' => array(
'rule' => array('notEmpty'),
'allowEmpty' => false,
'required' => true,
'message' => 'Inserire una mail.'
)
),
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment