joris

Model Rules

Oct 8th, 2015
234
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.93 KB | None | 0 0
  1. public function rules()
  2.     {
  3.         // NOTE: you should only define rules for those attributes that
  4.         // will receive user inputs.
  5.         return array(
  6.             array('slide_name, create_by, create_date, slide_image', 'required'),
  7.             array('create_by, update_by', 'numerical', 'integerOnly' => true),
  8.             array('slide_name', 'length', 'max' => 30),
  9.             array('slide_link, update_date', 'safe'),
  10.             array('slide_image', 'file', 'types'=>'jpg, png','maxSize'=>1024*1024*5,'tooLarge'=>'The file was larger than 5MB. Please upload a smaller file.'),
  11.             // The following rule is used by search().
  12.             // @todo Please remove those attributes that should not be searched.
  13.             array('id, slide_name, slide_image, slide_link, create_by, create_date, update_by, update_date', 'safe', 'on' => 'search'),
  14.         );
  15.     }
  16.  
  17.  
  18. slide_image   <<   ini nama field buat upload image
Advertisement
Add Comment
Please, Sign In to add comment