chinese-journal/yii/protected/models/AddPostForm.php
2014-11-21 08:26:20 +00:00

26 lines
399 B
PHP

<?php
class AddPostForm extends CFormModel
{
public $title;
public $text;
public $image;
/**
* Declares the validation rules.
* The rules state that username and password are required,
* and password needs to be authenticated.
*/
public function rules()
{
return array(
array('title, text, image', 'required'),
array('image', 'file', 'types'=>'jpg, gif, png'),
);
}
}