PHP Classes

File: contents/themes/simplecolor/controller/themeContactus.php

Recommend this page to a friend!
  Classes of Minh Tien   Noblesse CMS   contents/themes/simplecolor/controller/themeContactus.php   Download  
File: contents/themes/simplecolor/controller/themeContactus.php
Role: Example script
Content type: text/plain
Description: Example script
Class: Noblesse CMS
Content management system with custom plugins
Author: By
Last change: Improve system
Date: 9 years ago
Size: 1,122 bytes
 

Contents

Class file image Download
<?php

class themeContactus
{
    public function
index()
    {
       
// Cache::loadPage(30);

       
$inputData=array('alert'=>'');

       
Model::loadWithPath('contactus',System::getThemePath().'model/');

        if(
Request::has('btnSend'))
        {
            if(
Captcha::verify())
            {
                try {
                   
contactProcess();
                   
$inputData['alert']='<div class="alert alert-success">Send contact success.</div>';
                } catch (
Exception $e) {
                   
$inputData['alert']='<div class="alert alert-warning">'.$e->getMessage().'</div>';
                }
            }
            else
            {
               
$inputData['commentAlert']='<div class="alert alert-warning">Wrong captcha characters. Try again!</div>';
            }

        }
       
       
$inputData['captchaHTML']=Captcha::makeForm();

       
System::setTitle('Contact us');

       
self::makeContent('contactus',$inputData);
       
       
// Cache::savePage();
   
}

    public function
makeContent($viewName,$inputData=array())
    {
       
$themePath=System::getThemePath().'view/';

       
$inputData['themePath']=$themePath;

       
View::makeWithPath('head',array(),$themePath);

       
View::makeWithPath($viewName,$inputData,$themePath);

       
View::makeWithPath('footer',array(),$themePath);

    }


}

?>