本文整理汇总了PHP中Blog::getList方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::getList方法的具体用法?PHP Blog::getList怎么用?PHP Blog::getList使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::getList方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: latestAction
public function latestAction()
{
$limit = (int) $this->document->getProperty('limit');
if (!$limit) {
$limit = 3;
}
$this->view->entries = $this->_blog->getList(1, $limit)->getCurrentItems();
}
示例2: indexAction
public function indexAction(array $params)
{
$blogModel = new Blog();
$blog = $blogModel->getList();
// get from DB
$data = array('blog' => $blog);
$data = array('content' => $blog);
return $this->render('index', $data);
}
示例3: defaultAction
/**
* Entry list.
*
*/
public function defaultAction()
{
$this->enableLayout();
$this->view->paginator = $this->_blog->getList($this->_getParam('page', 1), $this->_getParam('perpage', 10));
}
示例4: blogHomepage
function blogHomepage()
{
$results = array();
$start_from = ($_GET['page'] - 1) * 5;
$data = Blog::getList($start_from, HOMEPAGE_NUM_BLOG);
$results['blog'] = $data['results'];
$results['totalRows'] = $data['totalRows'];
$results['pageTitle'] = "Widget News";
//print blog content
echo "<div id='output'>";
$data = Page::getPageByTitle($_GET['action']);
if ($data) {
if ($data->page_protection == '1' && !isset($_SESSION['name'])) {
echo "Please log-in to view this page.";
} else {
if ($data->page_status == 'draft') {
echo "This page is not yet published. Contact the site admin.";
} else {
echo "<p>" . $data->page_body . "</p>";
if ($results) {
$total_pages = ceil($results['totalRows'] / 5);
for ($i = 1; $i <= $total_pages; $i++) {
echo "<a href='#' title='" . $i . "' class='page'>" . $i . "</a> ";
}
foreach ($results['blog'] as $row) {
$results['author'] = User::getUserById($row->author_id);
$author_name = $results['author']->fname . " " . $results['author']->mname . " " . $results['author']->lname;
//echo '<img src="include/images/author.png" height="90px" width="110px" class="authorimage"/>';
echo '<h1 class="blogHeader" style="color:white;"><a href="#" title="' . $row->id . '" class="viewBlog">' . $row->title . '</a></h1><p id="smallText">Published on ' . $row->publicationDate . ' by ' . $author_name . '</p><p class="blogsummary">' . $row->summary . '</p><hr color="#d6d1bf"/>';
}
}
}
}
}
echo "</div>";
//end of bloog content
//sidebar
echo "<div id='sidebar'>";
if ($data) {
echo $data->page_sidebar;
}
echo "</div>";
//end of sidebar
}
示例5: executeIndex
public function executeIndex(sfWebRequest $request)
{
$this->page = $request->getParameter('page');
$this->count = Blog::getList('count');
$this->blog_list = Blog::getList($this->page);
}