isMobileBrowser() && $service->h5Enabled()) { $location = $service->getPageInfoUrl($id); return $this->response->redirect($location); } $service = new PageInfoService(); $page = $service->handle($id); if ($page['deleted'] == 1) { $this->notFound(); } if ($page['published'] == 0) { $this->notFound(); } $featuredCourses = $this->getFeaturedCourses(); $this->seo->prependTitle(['单页', $page['title']]); $this->view->setVar('page', $page); $this->view->setVar('featured_courses', $featuredCourses); } protected function getFeaturedCourses() { $service = new IndexService(); return $service->getSimpleFeaturedCourses(); } }