本文整理汇总了PHP中News::getNewsList方法的典型用法代码示例。如果您正苦于以下问题:PHP News::getNewsList方法的具体用法?PHP News::getNewsList怎么用?PHP News::getNewsList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类News
的用法示例。
在下文中一共展示了News::getNewsList方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
public function actionIndex()
{
$newsList = array();
$newsList = News::getNewsList();
require_once ROOT . '/views/news/index.php';
return true;
}
示例2: actionIndex
public function actionIndex()
{
$newsList = [];
$newsList = News::getNewsList();
require_once __DIR__ . "/../views/news/index.php";
return true;
}
示例3: actionIndex
public function actionIndex()
{
$newsList = array();
$newsList = News::getNewsList();
echo '<pre>';
print_r($newsList);
echo '</pre>';
return true;
}
示例4: array
<!DOCTYPE html>
<html>
<head>
<link href="/views/style.css" rel="stylesheet">
<meta charset="utf-8">
<title>Новости</title>
</head>
<body>
<div class="header">
<p>Название сайта</p>
</div>
<?php
include_once ROOT . '/models/news_model.php';
$value = array();
foreach (News::getNewsList() as $key => $value) {
// список новостей, используем статический метод модели News, чтобы получить записи из БД
echo '<div class="newsList">';
echo '<h2><a href="/news/' . ($key + 1) . '">' . $value['name'] . '</a></h2>';
echo $value['short_contents'] . '<br><br>';
echo '<p class="date">Дата добавления: ' . $value['date'] . '</p>';
echo '</div>';
}
?>
</body>
</html>
示例5: actionIndex
function actionIndex()
{
$newsList = array();
$newsList = News::getNewsList();
$this->view->generate('news/index.php', 'template.php', $newsList);
}
示例6: actionIndex
public function actionIndex()
{
$newsList = News::getNewsList();
require_once ROOT . '/app/views/news/newsListView.php';
return true;
}
示例7: News
<h3>
<span>
<?php
echo MY_NEWS;
?>
</span>
</h3>
<div class="myNews">
<form name="removeNews" id="removeNews" method="post" action="myNews.php" onsubmit="alert('asd')">
<input type="hidden" name="remove_news_id" />
</form>
<?
$news = new News();
$news->setUserID($_COOKIE['userID']);
$newsList = $news->getNewsList($page);
$rss = new lastRSS;
$rss->cache_dir = $baseDir."/rss/";
$rss->cache_time = 1200;
$rss->CDATA = "content";
echo "<ul>";
$titlesRSS = array();
/**
* Correndo todos os RSSs e pegando o titulo para mostrar na caixa auxiliar
*/
for($i = 0; $i < count($newsList); $i++)