Commit 059eefb1 authored by xiabin's avatar xiabin

修改播放事件

parent cd67bdbd
...@@ -90,14 +90,23 @@ class SiteController extends Controller ...@@ -90,14 +90,23 @@ class SiteController extends Controller
*/ */
public function actionError() public function actionError()
{ {
$this->layout = FALSE;
$exception = Yii::$app->errorHandler->exception; $exception = Yii::$app->errorHandler->exception;
$name = Yii::$app->errorHandler->getExceptionName($exception); if($exception->statusCode == '404' ){
$message = $exception->getMessage(); $name = Yii::$app->errorHandler->getExceptionName($exception);
if ($exception !== null) { $message = $exception->getMessage();
return $this->render('error', ['name' => $name, if ($exception !== null) {
'message'=>$message]); return $this->render('notfound', ['name' => $name,
'message'=>$message]);
}
}else{
$name = Yii::$app->errorHandler->getExceptionName($exception);
$message = $exception->getMessage();
if ($exception !== null) {
return $this->render('error', ['name' => $name,
'message'=>$message]);
}
} }
} }
/** /**
......
...@@ -20,7 +20,7 @@ $this->title = $name; ...@@ -20,7 +20,7 @@ $this->title = $name;
<meta name="keywords" content=""> <meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1"> <meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="shortcut icon" href="/favicon.ico"> <link rel="shortcut icon" href="<?=\frontend\assets\AppAsset::getStaticUrl('img/favicon.ico')?>">
<style> <style>
*{ *{
...@@ -89,10 +89,10 @@ $this->title = $name; ...@@ -89,10 +89,10 @@ $this->title = $name;
<div class="vertical-obj"> <div class="vertical-obj">
<div class="vertical-obj-cont"> <div class="vertical-obj-cont">
<div class="main-box"> <div class="main-box">
<img src="img/404.jpg"> <img src="<?=\frontend\assets\AppAsset::getStaticUrl('img/404.jpg')?>">
<p> <p>
<span><?= nl2br(Html::encode($message)) ?></span> <span><?= nl2br(Html::encode($message)) ?></span>
<a href="/">回首页</a> <a href="<?=\yii\helpers\Url::base()?>">回首页</a>
</p> </p>
</div> </div>
......
<?php
/* @var $this yii\web\View */
/* @var $name string */
/* @var $message string */
/* @var $exception Exception */
use yii\helpers\Html;
$this->title = $name;
?>
<!DOCTYPE html>
<html>
<head lang="zh-CN">
<title><?= Html::encode($this->title) ?></title>
<meta charset="UTF-8">
<meta name="description" content="">
<meta name="keywords" content="">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="shortcut icon" href="<?=\frontend\assets\AppAsset::getStaticUrl('img/favicon.ico')?>">
<style>
*{
margin: 0;
padding: 0;
}
html,body{
height: 100%;
width: 100%;
background-color: #f4f7f7;
font-family: "Microsoft YaHei", "Helvitica Neue", Helvitica, Arial, "Hiragino Sans GB", "Arial Regular", "Microsoft JhengHei", sans-serif;
}
.vertical-obj {
display: table;
width: 100%;
height: 100%;
min-height: 100%;
text-align: center;
}
.vertical-obj .vertical-obj-cont {
display: table-cell;
vertical-align: middle;
}
.main-box {
position: relative;
display: inline-block;
background-color: #f4f7f7;
box-shadow: 0 0 80px rgba(0,0,0,.05);
}
.main-box p {
position: absolute;
display: block;
width: 100%;
text-align: center;
top:50%;
left: 0;
}
.main-box p span {
display: block;
color: #999;
font-size: 12px;
padding-top: 40px;
}
.main-box p a {
display: inline-block;
padding: 0 30px;
height: 30px;
background-color: #f7cf89;
color: #fff;
text-align: center;
line-height: 30px;
text-decoration: none;
font-size: 12px;
margin-top: 30px;
}
.main-box p a:hover {
background-color: #f6c269;
color: #fff;
}
.main-box img {
max-width: 690px;
}
</style>
</head>
<body>
<div class="vertical-obj">
<div class="vertical-obj-cont">
<div class="main-box">
<img src="<?=\frontend\assets\AppAsset::getStaticUrl('img/404.jpg')?>">
<p>
<span><?= nl2br(Html::encode($message)) ?></span>
<a href="<?=\yii\helpers\Url::base()?>">回首页</a>
</p>
</div>
</div>
</div>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment