開発メモ

開発用のメモです。

EC CUBE バリデーション

<?php
$tag= array(
    array(1,"br"),
    array(2,"a"),
    array(3,"hr"),
    array(4,"h1"),
    array(5,"h2"),
    array(6,"h3"),
    array(7,"h4"),
    array(8,"h5"),
    array(9,"h6"),
);
$ext = array("jpg","png","gif");
$case1 = array(
     0 => array('項目1','field1', $tag),
     1 => array('項目1','field1'),
     2 => array('項目1','項目2','field1','field2'),
     3 => array('項目1','field1', 50),
     4 => array('項目1','field1a','field1b','field1c', 6, 11),
     5 => array('項目1','field1a','field1b','field1c'),
     6 => array('項目1','field1', 50, 60),
     7 => array('項目1','field1', $ext),
     8 => array('項目1','field1', 'dir'),
     9 => array('項目1','field1a','field1b','field1c','field1d','field13'),
    10 => array('項目1','field1a','field1b','field1c'),
    11 => array('項目1','項目2','field1a','field1b','field1c','field2a','field2b','field2c'),
    12 => array('項目1','項目2','field1a','field1b','field1c','field1d','field1e','field1f','field2a','field2b','field2c','field2d','field2e','field2f'),
    13 => array('項目1','項目2','field1a','field1b','field2a','field2b'),
);
# CHECK_NAME) チェック内容 サンプル
1 HTML_TAG_CHECK HTMLタグ許容 $objErr->doFunc($case1[ 0], array($CHECK_NAME));
2 EXIST_CHECK 必須チェック $objErr->doFunc($case1[ 1], array($CHECK_NAME));
3 SPTAB_CHECK 空白のみ不可 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
4 NO_SPTAB 空白不可 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
5 ZERO_START ゼロ開始禁止 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
6 SELECT_CHECK 必須(選択) $objErr->doFunc($case1[ 1], array($CHECK_NAME));
7 EQUAL_CHECK 一致 $objErr->doFunc($case1[ 2], array($CHECK_NAME));
8 DIFFERENT_CHECK 不一致 $objErr->doFunc($case1[ 2], array($CHECK_NAME));
9 GREATER_CHECK 指定値以上 $objErr->doFunc($case1[ 2], array($CHECK_NAME));
10 MAX_LENGTH_CHECK 最大桁数 $objErr->doFunc($case1[ 3], array($CHECK_NAME));
11 MIN_LENGTH_CHECK 最小桁数 $objErr->doFunc($case1[ 3], array($CHECK_NAME));
12 MAX_CHECK 最大値 $objErr->doFunc($case1[ 3], array($CHECK_NAME));
13 MIN_CHECK 最小値 $objErr->doFunc($case1[ 3], array($CHECK_NAME));
14 NUM_CHECK 整数 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
15 NUM_POINT_CHECK 少数 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
16 ALPHA_CHECK 英字 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
17 TEL_CHECK 電話 $objErr->doFunc($case1[ 4], array($CHECK_NAME));
18 FULL_EXIST_CHECK 複数項目全必須 $objErr->doFunc($case1[ 5], array($CHECK_NAME));
19 ALL_EXIST_CHECK 複数項目全必須 $objErr->doFunc($case1[ 5], array($CHECK_NAME));
20 ONE_EXIST_CHECK 複数項目一つ必須 $objErr->doFunc($case1[ 5], array($CHECK_NAME));
21 TOP_EXIST_CHECK 関連(上位必須) $objErr->doFunc($case1[ 5], array($CHECK_NAME));
22 KANA_CHECK カタカナ $objErr->doFunc($case1[ 1], array($CHECK_NAME));
23 KANABLANK_CHECK カタカナ+SP $objErr->doFunc($case1[ 1], array($CHECK_NAME));
24 ALNUM_CHECK 英数 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
25 GRAPH_CHECK 英数記号 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
26 ZERO_CHECK 0入力不可能 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
27 NUM_RANGE_CHECK 数値範囲 $objErr->doFunc($case1[ 6], array($CHECK_NAME));
28 NUM_COUNT_CHECK 固定桁数 $objErr->doFunc($case1[ 3], array($CHECK_NAME));
29 EMAIL_CHECK メールアドレス $objErr->doFunc($case1[ 1], array($CHECK_NAME));
30 EMAIL_CHAR_CHECK メールアドレス $objErr->doFunc($case1[ 1], array($CHECK_NAME));
31 URL_CHECK URL $objErr->doFunc($case1[ 1], array($CHECK_NAME));
32 IP_CHECK IP $objErr->doFunc($case1[ 1], array($CHECK_NAME));
33 FILE_EXT_CHECK 拡張子 $objErr->doFunc($case1[ 7], array($CHECK_NAME));
34 FIND_FILE FILE 必須 (SERVER) $objErr->doFunc($case1[ 8], array($CHECK_NAME));
35 FILE_EXIST_CHECK FILE 必須 (UPLOAD) $objErr->doFunc($case1[ 3], array($CHECK_NAME));
36 FILE_SIZE_CHECK FILE SIZE $objErr->doFunc($case1[ 3], array($CHECK_NAME));
37 FILE_NAME_CHECK FILE 名(EN/UPLOAD) $objErr->doFunc($case1[ 1], array($CHECK_NAME));
38 FILE_NAME_CHECK_BY_NOUPLOAD FILE 名(EN/SERVER) $objErr->doFunc($case1[ 1], array($CHECK_NAME));
39 CHECK_DATE 日付 (y/m/d) $objErr->doFunc($case1[ 5], array($CHECK_NAME));
40 CHECK_DATE2 日時 (y/m/d hh:mi) $objErr->doFunc($case1[ 9], array($CHECK_NAME));
41 CHECK_DATE3 年月 (y/m) $objErr->doFunc($case1[10], array($CHECK_NAME));
42 CHECK_BIRTHDAY 誕生日(1901~now) $objErr->doFunc($case1[ 5], array($CHECK_NAME));
43 CHECK_SET_TERM 日付 (開始 < 終了) $objErr->doFunc($case1[11], array($CHECK_NAME));
44 CHECK_SET_TERM2 日時 (開始 < 終了) $objErr->doFunc($case1[12], array($CHECK_NAME));
45 CHECK_SET_TERM3 年月 (開始 < 終了) $objErr->doFunc($case1[13], array($CHECK_NAME));
46 DIR_CHECK ディレクトリ存在 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
47 DOMAIN_CHECK ドメイン形式 $objErr->doFunc($case1[ 1], array($CHECK_NAME));
48 MOBILE_EMAIL_CHECK 携帯メールアドレス $objErr->doFunc($case1[ 1], array($CHECK_NAME));
49 CHECK_REGIST_CUSTOMER_EMAIL 登録済メールアドレス $objErr->doFunc($case1[ 1], array($CHECK_NAME));
50 PROHIBITED_STR_CHECK 入力禁止文字列存在 $objErr->doFunc($case1[ 7], array($CHECK_NAME));
Twitter: @asahina_alice