Website is working!

This commit is contained in:
vladislav.khorev committed 2014-11-22 13:14:22 +00:00
1 parent c978ba8e19
commit 2ed0710575
24 files changed
+644 -119

No files matched your search

+13 -2
View File
@@ -6,6 +6,7 @@ class AddPostForm extends CFormModel
public $title;
public $text;
public $image;
public $date;
/**
@@ -16,10 +17,20 @@ class AddPostForm extends CFormModel
public function rules()
{
return array(
array('title, text, image', 'required'),
array('image', 'file', 'types'=>'jpg, gif, png'),
array('title, text, image', 'required', 'message'=>'{attribute} ' . Yii::t('app', 'Field should not be blank')),
array('title', 'length', 'max'=>45, 'tooLong'=>'{attribute} ' . Yii::t('app', 'Line is too long')),
array('image', 'file', 'types'=>'jpg, gif, png', 'maxSize'=>8388608, 'message'=>'{attribute} ' . Yii::t('app', 'Image must be jpg, gif or png, and its size should not exceed 8 megabytes')),
);
}
function attributeLabels(){
return array(
'title' => Yii::t('app', 'Title:'),
'text' => Yii::t('app', 'Text:'),
'image' => Yii::t('app', 'Image:'),
);
}
}