/** * * @return void */ public function contact() { $this->loadModel('content'); Loader::library('Form'); $data = array(); if (Input::post()) { Form::rule('name', 'trim|required|alpha|maxLength:100'); Form::rule('email', 'trim|required|validEmail|maxLength:100'); Form::rule('message', 'trim|required|maxLength:5000'); Form::rule('captcha', 'trim|required|numeric|verifyCaptcha'); if (Form::run() === TRUE) { $sendData = array('name' => Input::post('name'), 'email' => Input::post('email'), 'message' => Input::post('message')); $data = $this->mContent->sendMessage($sendData); } else { $data = array('success' => FALSE, 'result' => Form::errors()); } } $data['sidebarLayout'] = View::render('content/vSidebar', array('page' => 'contact'), TRUE); Layout::title('Contact'); Layout::desc('Contact us.'); Layout::view('content/vContact', $data); }