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


PHP Blog::blogs方法代码示例

本文整理汇总了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');
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:12,代码来源:admin.blog.controller.php

示例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;
		}
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:18,代码来源:menu.php

示例3: fetchLatest

	protected function fetchLatest($page = 1)
	{
		$pager = Blog::blogs(CoOrg::getLanguage());
		$this->blogs = $pager->execute($page, 10);
		$this->blogpager = $pager;
		return true;
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:7,代码来源:blog.controller.php

示例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);
	}
开发者ID:nathansamson,项目名称:CoOrg,代码行数:22,代码来源:blog.model.Test.php


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