public function tagAction($args = null) { global $app, $tpl; try { if (!isset($args['name'])) { throw new Exception('请输入合法Tag标签'); } $page = new Page(); $page->Page = $args['page']; $page->Url = SITE_URL . 'tag/' . trim($args['name']) . '/'; $page->Condition = '/'; $result = Article::findByTag(trim($args['name']), $page); $page->Count = $result['count']; } catch (Exception $e) { //die($e->getMessage()); $app->error($e->getMessage(), SITE_URL); } $tpl->assign('post_list', $result['res']); $tpl->assign('tag', $args['name']); $tpl->assign('page_nav', $page->getPage()); $tpl->display(DEFAULT_TEMPLATE . '/list.html'); }