1
0

Added Contactform on Aboutpage

This commit is contained in:
2014-05-14 14:14:45 +02:00
parent a2b684eee1
commit 812220ed8e
4 changed files with 366 additions and 260 deletions

View File

@@ -22,6 +22,39 @@ class SiteController extends Controller
public function actionAbout()
{
$this->render('about');
$data = array();
if(isset($_POST['SendMailForm']))
{
$model = new SendMailForm();
$model->attributes=$_POST['SendMailForm'];
if($model->validate()) {
if ($model->send())
{
$data['alerts_success'][] = "Successfully send mail from " . $model->name;
$data['model'] = new SendMailForm();
}
else
{
$data['alerts_error'][] = "Internal error while sending mail";
$data['model'] = $model;
}
}
else
{
$data['model'] = $model;
}
}
else
{
$data['model'] = new SendMailForm();
}
$this->render('about', $data);
}
}