<?php include '../init.php'; require_once SROOT . 'articleService.class.php'; require_once SROOT . 'categoryService.class.php'; $as = new ArticleService(); $as->staticIndex(); $cs = new CategoryService(); $cs->staticCategoryJs(); $cList = $cs->getAll(); foreach ($cList as $row) { $as->staticArticleList($row); } $aList = $as->getAll(1); foreach ($aList as $row) { $as->staticArticle($row['id']); }
<?php include '..' . DIRECTORY_SEPARATOR . 'init.php'; include SROOT . 'articleService.class.php'; $article_service = new ArticleService(); $article_list = $article_service->getAll(ARTICLE_PUBLISH, v('cid') ? v('cid') : null, v('page') ? v('page') : null); if ($article_list) { send_result(1, $article_list); } else { send_result(0, 'empty data'); }
<?php include 'init.php'; include SROOT . 'articleService.class.php'; $service = new ArticleService(); $status = isset($_GET['status']) ? v('status') : 1; $result = $service->getAll($status); if ($result) { $data = array('result' => $result, 'status' => $status); render('article.list', $data); } else { $data = array('status' => $status); render('article.list', $data); }