本文整理汇总了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);
}