1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-20 11:03:01 +08:00
koogua 0336a54911 1.源文件增加版权信息
2.群组状态和课程协同
2021-06-13 15:49:47 +08:00

51 lines
1.1 KiB
PHP

<?php
/**
* @copyright Copyright (c) 2021 深圳市酷瓜软件有限公司
* @license https://opensource.org/licenses/GPL-2.0
* @link https://www.koogua.com
*/
namespace App\Http\Home\Controllers;
use App\Services\Logic\Topic\CourseList as TopicCourseListService;
use App\Services\Logic\Topic\TopicInfo as TopicInfoService;
use Phalcon\Mvc\View;
/**
* @RoutePrefix("/topic")
*/
class TopicController extends Controller
{
/**
* @Get("/{id:[0-9]+}", name="home.topic.show")
*/
public function showAction($id)
{
$service = new TopicInfoService();
$topic = $service->handle($id);
$this->seo->prependTitle(['专题', $topic['title']]);
$this->seo->setDescription($topic['summary']);
$this->view->setVar('topic', $topic);
}
/**
* @Get("/{id:[0-9]+}/courses", name="home.topic.courses")
*/
public function coursesAction($id)
{
$service = new TopicCourseListService();
$pager = $service->handle($id);
$pager->target = 'course-list';
$this->view->setRenderLevel(View::LEVEL_ACTION_VIEW);
$this->view->setVar('pager', $pager);
}
}