Welcome to the Cookbook

loading...

4.1.4.4 boolean

このセクションには保留されている変更があります. More information about translations

The data for the field must be a boolean value. Valid values are true or false, integers 0 or 1 or strings '0' or '1'.

var $validate = array(
    'myCheckbox' => array(
        'rule' => array('boolean'),
        'message' => 'Incorrect value for myCheckbox'
    )
);
  1. var $validate = array(
  2. 'myCheckbox' => array(
  3. 'rule' => array('boolean'),
  4. 'message' => 'Incorrect value for myCheckbox'
  5. )
  6. );