本文整理汇总了PHP中News::getNews方法的典型用法代码示例。如果您正苦于以下问题:PHP News::getNews方法的具体用法?PHP News::getNews怎么用?PHP News::getNews使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类News
的用法示例。
在下文中一共展示了News::getNews方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionIndex
/**
* Action для страницы "Новости"
*/
public function actionIndex()
{
$categories = Category::getCategoriesList();
$news = News::getNews();
require_once ROOT . '/views/news/index.php';
return true;
}
示例2: run
public function run()
{
$news = News::getNews($this->offset, $this->limit, $this->type);
switch ($this->type) {
case 1:
$this->echoPicText($news);
break;
case 2:
$this->echoPic($news);
break;
}
}
示例3: News
*/
define('LANG_FILE', 'editor.php');
define('NO_2LEVEL_CHK', 1);
require_once $root_path . 'include/inc_front_chain_lang.php';
require_once $root_path . 'include/inc_cafe_get_menu.php';
$returnfile = $_SESSION['sess_file_return'] . URL_APPEND;
$breakfile = $_SESSION['sess_file_break'] . URL_APPEND;
$dept_nr = 2;
/* 2= cafeteria */
if (!isset($mode)) {
$mode = '';
}
/* Get the news article */
require_once $root_path . 'include/care_api_classes/class_news.php';
$newsobj = new News();
$news =& $newsobj->getNews($nr);
# Start Smarty templating here
/**
* LOAD Smarty
*/
# Note: it is advisable to load this after the inc_front_chain_lang.php so
# that the smarty script can use the user configured template theme
require_once $root_path . 'gui/smarty_template/smarty_care.class.php';
$smarty = new smarty_care('common');
# Hide the title bar
$smarty->assign('bHideTitleBar', TRUE);
$smarty->assign('news_normal_display_width', $news_normal_display_width);
# Headline title
$smarty->assign('LDHeadline', $LDCafeNews);
# Collect javascript code
ob_start();
示例4: getPage
public function getPage()
{
$back = '';
$back .= "\n\t\t\t<div id='xy_jobTwo_body'>\n\t\t\t\t<div>\n\t\t\t\t\t<img src='{$this->arr['root_dir']}img/xy/jobTwo.jpg' class='xy_jobTwo_img'/>\n\t\t\t\t</div>\n\t\t";
$page1 = 1;
$page2 = 1;
$page_str = $this->arr['news_page'];
$news = new News($this->arr);
foreach ($this->arr['xml']->header->nav->li as $li) {
if (strtolower($li['kind']) === 'a4') {
foreach ($li->span as $span) {
$title = strtolower($span['title']);
$skind = strtolower($span['kind']);
$news_type = (int) $span['news-type'];
if ($page_str === 1) {
$page = 1;
} else {
$kind = substr($page_str, 0, 2);
if ($kind === $skind) {
$arr = explode('_', $page_str);
$page = (int) $arr[1];
} else {
$page = 1;
}
}
$back .= $news->getNews($news_type, $title, $page, 9, array('kind' => "{$skind}"), 'wrapNews2');
$back .= "</div>";
}
}
}
return $back;
}
示例5: actionIndex
/**
* Action для страницы "Управление новостями"
*/
public function actionIndex()
{
$newsList = News::getNews();
require_once ROOT . '/views/admin_news/index.php';
return true;
}
示例6: News
<?php
include_once "../includes/webservice.inc.php";
$webService = new Webservices_Writer();
$webService->init();
/* to get news details */
$news = new News();
$result = $news->getNews();
if (count($result) > 0) {
$webService->createXMLInstance();
$webService->appendArrayToRootNode('', $result);
$webService->displayXML();
}
/* end */
示例7: NewsComponent
<?php
$page = PageContent::getInstance();
$id = Url::getCurrentUrl()->getQueryVar('id');
$news = News::getNews($id);
$page->addComponent(new NewsComponent($news));
示例8: showAction
public function showAction()
{
$matches = MatchController::getQueryBuilder()->sortBy('time')->reverse()->limit(6)->fromPage(1);
return array("matches" => $matches->getModels(), "news" => News::getNews(0, 5));
}