isMobileBrowser() && $service->h5Enabled()) { $location = $service->getTeacherListUrl(); return $this->response->redirect($location); } $this->seo->prependTitle('教师'); } /** * @Get("/pager", name="home.teacher.pager") */ public function pagerAction() { $service = new TeacherListService(); $pager = $service->handle(); $pager->target = 'teacher-list'; $this->view->setRenderLevel(View::LEVEL_ACTION_VIEW); $this->view->setVar('pager', $pager); } /** * @Get("/{id:[0-9]+}", name="home.teacher.show") */ public function showAction($id) { $service = new FullH5UrlService(); if ($service->isMobileBrowser() && $service->h5Enabled()) { $location = $service->getTeacherIndexUrl($id); return $this->response->redirect($location); } $this->dispatcher->forward([ 'controller' => 'user', 'action' => 'show', 'params' => ['id' => $id], ]); } }