diff --git a/config/web.php b/config/web.php index 16bc5a1..7622bc3 100644 --- a/config/web.php +++ b/config/web.php @@ -7,7 +7,7 @@ return array( 'modules' => array( 'debug' => array( 'class' => 'yii\debug\Module', - 'enabled' => YII_DEBUG && YII_ENV_DEV, + 'enabled' => YII_ENV_DEV, ), ), 'components' => array( @@ -15,9 +15,11 @@ return array( 'class' => 'yii\caching\FileCache', ), 'user' => array( - 'class' => 'yii\web\User', 'identityClass' => 'app\models\User', ), + 'errorHandler' => array( + 'errorAction' => 'site/error', + ), 'log' => array( 'traceLevel' => YII_DEBUG ? 3 : 0, 'targets' => array( diff --git a/controllers/SiteController.php b/controllers/SiteController.php index 04da8b3..0c73873 100644 --- a/controllers/SiteController.php +++ b/controllers/SiteController.php @@ -12,9 +12,12 @@ class SiteController extends Controller public function actions() { return array( + 'error' => array( + 'class' => 'yii\web\ErrorAction', + ), 'captcha' => array( 'class' => 'yii\captcha\CaptchaAction', - 'fixedVerifyCode' => YII_ENV_DEV ? 'testme' : null, + 'fixedVerifyCode' => YII_ENV_TEST ? 'testme' : null, ), ); } diff --git a/views/site/about.php b/views/site/about.php index 5766d55..967b8fe 100644 --- a/views/site/about.php +++ b/views/site/about.php @@ -7,11 +7,12 @@ use yii\helpers\Html; $this->title = 'About'; $this->params['breadcrumbs'][] = $this->title; ?> -

title); ?>

+
+

title); ?>

-

- This is the About page. You may modify the following file to customize its content: -

- - +

+ This is the About page. You may modify the following file to customize its content: +

+ +
diff --git a/views/site/contact.php b/views/site/contact.php index 2183bd3..eb6e0f5 100644 --- a/views/site/contact.php +++ b/views/site/contact.php @@ -11,32 +11,38 @@ use yii\captcha\Captcha; $this->title = 'Contact'; $this->params['breadcrumbs'][] = $this->title; ?> -

title); ?>

+
+

title); ?>

-session->hasFlash('contactFormSubmitted')): ?> -
- Thank you for contacting us. We will respond to you as soon as possible. -
- + session->hasFlash('contactFormSubmitted')): ?> -

- If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. -

- -
-
- 'contact-form')); ?> - field($model, 'name')->textInput(); ?> - field($model, 'email')->textInput(); ?> - field($model, 'subject')->textInput(); ?> - field($model, 'body')->textArea(array('rows' => 6)); ?> - field($model, 'verifyCode')->widget(Captcha::className(), array( - 'options' => array('class' => 'form-control'), - 'template' => '
{image}
{input}
', - )); ?> -
- 'btn btn-primary')); ?> -
- +
+ Thank you for contacting us. We will respond to you as soon as possible.
+ + + +

+ If you have business inquiries or other questions, please fill out the following form to contact us. Thank you. +

+ +
+
+ 'contact-form')); ?> + field($model, 'name')->textInput(); ?> + field($model, 'email')->textInput(); ?> + field($model, 'subject')->textInput(); ?> + field($model, 'body')->textArea(array('rows' => 6)); ?> + field($model, 'verifyCode')->widget(Captcha::className(), array( + 'options' => array('class' => 'form-control'), + 'template' => '
{image}
{input}
', + )); ?> +
+ 'btn btn-primary')); ?> +
+ +
+
+ +
diff --git a/views/site/error.php b/views/site/error.php new file mode 100644 index 0000000..024e27d --- /dev/null +++ b/views/site/error.php @@ -0,0 +1,29 @@ +title = $name; +?> +
+ +

title); ?>

+ +
+ +
+ +

+ The above error occurred while the Web server was processing your request. +

+

+ Please contact us if you think this is a server error. Thank you. +

+ +
diff --git a/views/site/index.php b/views/site/index.php index 7e86eb6..bc084da 100644 --- a/views/site/index.php +++ b/views/site/index.php @@ -2,50 +2,52 @@ /** * @var yii\base\View $this */ -$this->title = 'Welcome'; +$this->title = 'My Yii Application'; ?> -
-

Congratulations!

+
-

You have successfully created your Yii-powered application.

+
+

Congratulations!

-

Get started with Yii

-
+

You have successfully created your Yii-powered application.

-
- -
-
-

Heading

- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu - fugiat nulla pariatur.

- -

Yii Documentation »

-
-
-

Heading

- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu - fugiat nulla pariatur.

- -

Yii Forum »

-
-
-

Heading

- -

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et - dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip - ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu - fugiat nulla pariatur.

- -

Yii Extensions »

-
+

Get started with Yii

-
+
+
+
+

Heading

+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

+ +

Yii Documentation »

+
+
+

Heading

+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

+ +

Yii Forum »

+
+
+

Heading

+ +

Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et + dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip + ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu + fugiat nulla pariatur.

+ +

Yii Extensions »

+
+
+ +
+
diff --git a/views/site/login.php b/views/site/login.php index efe47e0..15ec52b 100644 --- a/views/site/login.php +++ b/views/site/login.php @@ -10,19 +10,21 @@ use yii\widgets\ActiveForm; $this->title = 'Login'; $this->params['breadcrumbs'][] = $this->title; ?> -

title); ?>

+