本文整理汇总了PHP中News::getAll方法的典型用法代码示例。如果您正苦于以下问题:PHP News::getAll方法的具体用法?PHP News::getAll怎么用?PHP News::getAll使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类News
的用法示例。
在下文中一共展示了News::getAll方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionAll
public function actionAll()
{
$items = News::getAll();
$view = new View();
$view->items = $items;
$view->display('view.php');
}
示例2: actionAll
public function actionAll()
{
$news = News::getAll();
$view = new View();
$view->items = $news;
$view->display('news/all.php');
}
示例3: actionOne
public function actionOne()
{
$id = $_GET['id'];
$items = News::delOne($id);
News::getAll();
require_once __DIR__ . '/../views/one.php';
}
示例4: actionGetAll
public function actionGetAll()
{
$NewsItems = News::getAll();
$ViewObj = new View();
$ViewObj->assign('items', $NewsItems);
$template = 'news/news_view.php';
$ViewObj->display($template);
}
示例5: indexAction
public function indexAction()
{
$this->view->Title = "Management news";
$this->view->headTitle($this->view->Title);
$page = $this->getRequest()->getParam('page');
$condition = array();
list($this->view->Pager, $this->view->News) = News::getAll($condition, $page);
}
示例6: indexAction
public function indexAction()
{
$group = $this->getRequest()->getParam("group");
$condition = array("group_id=?" => $group);
$page = $this->getRequest()->getParam('page');
list($this->view->Pager, $this->view->News) = News::getAll($condition, $page, 10, $order = 'id DESC');
$this->view->Group = $group;
$GroupName = NewGroup::getById($group);
$this->view->Title = $GroupName->name;
$this->view->headTitle($this->view->Title);
}
示例7: actionAll
public function actionAll()
{
$items = News::getAll();
include __DIR__ . '/../views/news/all.php';
}
示例8: News
<?php
include 'config.php';
include 'classes/News.php';
include 'classes/DataBase.php';
include 'classes/AddNews.php';
$page = new News();
if (isset($_GET['id'])) {
$id = (int) $_GET['id'];
if ($id != 0) {
$text = $page->getOne($id);
echo $page->getBody($text, 'view');
} else {
exit('wrong');
}
} else {
$text = $page->getAll();
echo $page->getBody($text, 'main');
}
示例9: News
<?php
/**
* Created by PhpStorm.
* User: Alex Sandiyarov
* Date: 13.12.15
* Time: 12:17
*/
$news = new News();
$a = $news->getAll();
var_dump($a);
//$news->add($data);
//$news->update($title2, $id);
$a = new sql();
$a->get('*', 'news', 'ORDER BY date DESC');
print_r($a->packToArray());
print_r($a->get('*', 'news', 'WHERE id = 4'));
$a->insert('news', 'id, title', '"34543435434534353453455", "sadsadas"');
$a->update('news', 'title = "KUKU"', '4');
示例10: News
//Vars
$news_title = $selectNewsArticle['news_title'];
$news_desc = $selectNewsArticle['news_description'];
$news_content = $selectNewsArticle['news_content'];
//View
include 'views/admin_page.php';
break;
case 'logout':
// View
include 'views/logout.php';
break;
case 'policy':
// View
include 'views/policy.php';
break;
//Default Page
//Default Page
default:
// Model
$News = new News();
$getNews = $News->getAll();
$Section1 = new Section1();
$getSection1 = $Section1->getAll();
// View
include "views/navigation.php";
include 'views/header.php';
include 'views/home.php';
break;
}
//Footer
include "views/footer.php";
示例11: DB
<?php
require_once __DIR__ . './classes/DB.php';
require_once __DIR__ . './models/news.php';
$db = new DB();
$items = $db->query('SELECT * FROM news');
$news = new News();
$items = News::getAll();
include __DIR__ . '/view/index.php';
phpinfo();
示例12: actionAll
public function actionAll()
{
$newsItems = News::getAll();
include __DIR__ . "/../views/newsAll.php";
}