Skip to content

Commit

Permalink
Yacsv setting (Post.php)
Browse files Browse the repository at this point in the history
  • Loading branch information
k1LoW committed Jul 18, 2013
1 parent 34f304c commit f344eb2
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions app/Model/Post.php
Expand Up @@ -17,6 +17,17 @@ class Post extends AppModel {
'Yacsv.Importer',
);

// POSTされているCSVファイルのフィールド名
public $importFilterArgs = array(
array('name' => 'csvfile'), // $data['Post']['csvfile']でPOSTされてくる
);

// 何列目がどのフィールドか
public $importFields = array(
'title', // 1列目はPost.title
'body', // 2列目はPost.body
);

public $validate = array(
'title' => array(
'notEmptyTitle' => array(
Expand Down

0 comments on commit f344eb2

Please sign in to comment.