Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zuiketang
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
夏彬
zuiketang
Commits
028f7a8a
Commit
028f7a8a
authored
Oct 26, 2016
by
xiabin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 404
parent
066dc72f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
4 deletions
+5
-4
HomeController.php
src/frontend/controllers/HomeController.php
+5
-3
index.php
src/frontend/views/my-course/index.php
+0
-1
No files found.
src/frontend/controllers/HomeController.php
View file @
028f7a8a
...
...
@@ -21,6 +21,7 @@ use yii\filters\AccessControl;
use
yii\helpers\ArrayHelper
;
use
yii\helpers\Html
;
use
yii\web\ForbiddenHttpException
;
use
yii\web\HttpException
;
class
HomeController
extends
\yii\web\Controller
{
...
...
@@ -60,6 +61,7 @@ class HomeController extends \yii\web\Controller
* 首页
* @param $classId 课堂id
* @return string
* @throws HttpException
*/
public
function
actionIndex
(
$classId
)
{
...
...
@@ -71,7 +73,7 @@ class HomeController extends \yii\web\Controller
'classInfo'
=>
$classInfo
]);
}
else
{
throw
new
InvalidParamException
(
'参数错误
'
);
throw
new
HttpException
(
404
,
'页面不存在
'
);
}
}
...
...
@@ -82,7 +84,7 @@ class HomeController extends \yii\web\Controller
* @param $classId
* @param $page
* @param int $num
* @throws
Forbidden
HttpException
* @throws HttpException
*/
public
function
actionGetCourseLists
(
$classId
,
$page
,
$num
=
10
)
{
...
...
@@ -90,7 +92,7 @@ class HomeController extends \yii\web\Controller
if
(
$page
>=
0
and
$num
>
0
)
{
$result
=
Course
::
getCourseListsByClassId
(
$classId
,
$page
,
$num
);
}
else
{
throw
new
InvalidParamException
(
'参数错误
'
);
throw
new
HttpException
(
404
,
'页面不存在
'
);
}
}
else
{
throw
new
ForbiddenHttpException
(
'非法请求'
);
...
...
src/frontend/views/my-course/index.php
View file @
028f7a8a
...
...
@@ -43,7 +43,6 @@ $qiniu = \Yii::$app->qiniu;
target=
"_blank"
>
<?=
$course
[
'name'
]
?>
</a></div>
<?php
endif
;
?>
<div
class=
"teacher"
>
<?php
if
(
$course
[
'teachers'
])
{
?>
讲师:
<?=
join
(
', '
,
array_column
(
$course
[
'teachers'
],
'name'
))
?><?php
}
?>
</div>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment