本文整理匯總了PHP中NewsModel::getAllByDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP NewsModel::getAllByDate方法的具體用法?PHP NewsModel::getAllByDate怎麽用?PHP NewsModel::getAllByDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類NewsModel
的用法示例。
在下文中一共展示了NewsModel::getAllByDate方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getNews
public function getNews($date = null)
{
if ($date == null) {
$news_items = NewsModel::getAllNews();
$date = 'archive';
} else {
if (strlen($date) == 8) {
$news_items = NewsModel::getAllByDate($date);
} else {
$news_items = array(NewsModel::getOneByDate($date));
}
}
$this->addCSSFiles('news.css');
return $this->renderPage(array('title' => 'Home', 'content_title' => 'Latest Developments', 'show_intro' => false, 'news_items' => $news_items, 'news_archive_link' => false, 'date' => $date), $this->_template);
}
示例2: getNews
public function getNews($date = null)
{
global $Smarty;
if ($date == null) {
$news_items = NewsModel::getAllNews();
$date = 'archive';
} else {
if (strlen($date) == 8) {
$news_items = NewsModel::getAllByDate($date);
} else {
$news_items = array(NewsModel::getOneByDate($date));
}
}
$this->addCSSFiles('news.css');
return $this->renderPage(array('title' => $Smarty->_config[0]['vars']['newsTitle'], 'content_title' => $Smarty->_config[0]['vars']['newsContentTitle'], 'show_intro' => false, 'news_items' => $news_items, 'news_archive_link' => false, 'date' => $date), $this->_template);
}