当前位置: 首页>>代码示例>>PHP>>正文


PHP Blog::getList方法代码示例

本文整理汇总了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();
 }
开发者ID:weblizards-gmbh,项目名称:blog,代码行数:8,代码来源:SnippetController.php

示例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);
 }
开发者ID:OlehGit,项目名称:mydemo,代码行数:9,代码来源:IndexController.php

示例3: defaultAction

 /**
  * Entry list.
  *
  */
 public function defaultAction()
 {
     $this->enableLayout();
     $this->view->paginator = $this->_blog->getList($this->_getParam('page', 1), $this->_getParam('perpage', 10));
 }
开发者ID:weblizards-gmbh,项目名称:blog,代码行数:9,代码来源:EntryController.php

示例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
}
开发者ID:neequole,项目名称:sp2,代码行数:44,代码来源:index.php

示例5: executeIndex

 public function executeIndex(sfWebRequest $request)
 {
     $this->page = $request->getParameter('page');
     $this->count = Blog::getList('count');
     $this->blog_list = Blog::getList($this->page);
 }
开发者ID:auphau,项目名称:joyreactor,代码行数:6,代码来源:actions.class.php


注:本文中的Blog::getList方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。