PHP Class Timber\PostQuery

PostCollections are used directly in Twig templates to iterate through and retrieve meta information about the collection of posts
Inheritance: extends PostCollection
Show file Open project: jarednova/timber

Protected Properties

Property Type Description
$pagination
$queryIterator
$userQuery

Public Methods

Method Description
__construct ( mixed $query = false, string $post_class = '\Timber\Post' )
pagination ( array $prefs = [] ) : Timber\Pagination Set pagination for the collection. Optionally could be used to get pagination with custom preferences.

Protected Methods

Method Description
get_query ( ) : mixed

Method Details

__construct() public method

public __construct ( mixed $query = false, string $post_class = '\Timber\Post' )
$query mixed
$post_class string

get_query() protected method

protected get_query ( ) : mixed
return mixed the query the user orignally passed to the pagination object

pagination() public method

Set pagination for the collection. Optionally could be used to get pagination with custom preferences.
public pagination ( array $prefs = [] ) : Timber\Pagination
$prefs array
return Timber\Pagination object

Property Details

$pagination protected property

protected $pagination

$queryIterator protected property

protected $queryIterator

$userQuery protected property

protected $userQuery