26 lines
399 B
PHP
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'),
|
|
);
|
|
}
|
|
|
|
|
|
}
|