Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
<?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