本文整理汇总了PHP中Blog::blogs方法的典型用法代码示例。如果您正苦于以下问题:PHP Blog::blogs方法的具体用法?PHP Blog::blogs怎么用?PHP Blog::blogs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Blog
的用法示例。
在下文中一共展示了Blog::blogs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: index
/**
* @Acl allow blog-writer
* @Acl allow blog-admin
*/
public function index($page = 1)
{
$this->_adminTab = 'BlogManageAdminTab';
$blogPager = Blog::blogs(CoOrg::getLanguage());
$this->blogs = $blogPager->execute($page, 15);
$this->blogpager = $blogPager;
$this->render('admin/index');
}
示例2: listData
public static function listData($action, $language)
{
if ($action == 'show')
{
$pager = Blog::blogs($language);
$blogs = $pager->execute(0, 0);
$menu = array();
foreach ($blogs as $blog)
{
$menu[date('Y-m-d', $blog->datePosted).'/'.$blog->ID] = $blog->title;
}
return $menu;
}
else
{
return null;
}
}
示例3: fetchLatest
protected function fetchLatest($page = 1)
{
$pager = Blog::blogs(CoOrg::getLanguage());
$this->blogs = $pager->execute($page, 10);
$this->blogpager = $pager;
return true;
}
示例4: testBlogs
public function testBlogs()
{
$blogPager = Blog::blogs('en');
$blogs = $blogPager->execute(1, 3);
$this->assertEquals(3, count($blogs));
$this->assertEquals('XYZ', $blogs[0]->title);
$this->assertEquals('XYZER', $blogs[1]->title);
$this->assertEquals('Some Blog', $blogs[2]->title);
$blogs = $blogPager->execute(2, 3);
$this->assertEquals(2, count($blogs));
$this->assertEquals('Some Other Blog', $blogs[0]->title);
$this->assertEquals('Blog post', $blogs[1]->title);
$blogs = $blogPager->execute(1, 10);
$this->assertEquals(5, count($blogs));
$this->assertEquals('XYZ', $blogs[0]->title);
$this->assertEquals('XYZER', $blogs[1]->title);
$this->assertEquals('Some Blog', $blogs[2]->title);
$this->assertEquals('Some Other Blog', $blogs[3]->title);
$this->assertEquals('Blog post', $blogs[4]->title);
}