pictcode / app / Model / ContactValidate.php @ 1711ffed
履歴 | 表示 | アノテート | ダウンロード (1010 Bytes)
| 1 | 33ddd711 | admin | <?php
|
|---|---|---|---|
| 2 | App::uses('AppModel', 'Model'); |
||
| 3 | /**
|
||
| 4 | * ContactValidate Model
|
||
| 5 | *
|
||
| 6 | */
|
||
| 7 | class ContactValidate extends AppModel { |
||
| 8 | |||
| 9 | public $useTable = false; |
||
| 10 | var $name = 'ContactValidate'; |
||
| 11 | |||
| 12 | public $_schema = array( |
||
| 13 | 'name' => array( |
||
| 14 | 'type' => 'string', |
||
| 15 | 'length' => 128, |
||
| 16 | ), |
||
| 17 | 'mail' => array( |
||
| 18 | 'type' => 'string', |
||
| 19 | 'length' => 255, |
||
| 20 | ), |
||
| 21 | 'comment' => array( |
||
| 22 | 'type' => 'string', |
||
| 23 | 'length' => 255, |
||
| 24 | ), |
||
| 25 | ); |
||
| 26 | |||
| 27 | /**
|
||
| 28 | * Validation rules
|
||
| 29 | *
|
||
| 30 | * @var array
|
||
| 31 | */
|
||
| 32 | public $validate = array( |
||
| 33 | 'name' => array( |
||
| 34 | 'notblank' => array( |
||
| 35 | 'rule' => array('notBlank'), |
||
| 36 | 'message' => '入力されていません', |
||
| 37 | ), |
||
| 38 | ), |
||
| 39 | 'mail' => array( |
||
| 40 | 'notblank' => array( |
||
| 41 | 'rule' => array('notBlank'), |
||
| 42 | 'message' => '入力されていません', |
||
| 43 | ), |
||
| 44 | 'isEmail' => array( |
||
| 45 | 'rule' => 'Email', |
||
| 46 | 'message' => '入力形式が正しくありません', |
||
| 47 | ), |
||
| 48 | ), |
||
| 49 | 'comment' => array( |
||
| 50 | 'notblank' => array( |
||
| 51 | 'rule' => array('notblank'), |
||
| 52 | 'message' => '入力されていません', |
||
| 53 | ), |
||
| 54 | ), |
||
| 55 | ); |
||
| 56 | } |