1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【FuelPHP】確認用の値と同じかどうかのValiadaiton

Posted at

#【FuelPHP】確認用の値と同じかどうかのValiadaiton

add_ruleでmatch_fieldを使う


emailの入力で確認用と同じかどうかの検証
formのnameがemailとemail_re(確認用)とする

//emailの入力の検証
	$val->add('email', 'email')
		->add_rule('required')
		->add_rule('match_field','email_re');

//emailの確認用の入力の検証			
	$val->add('email_re', '確認用')
		->add_rule('required');

//バリデーションメッセージは下記で設定。param:1は確認用のラベルが表示される。
	'match_field'      => '『:label』は『:param:1』と一致していません。',
	
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?