本文整理匯總了PHP中ItemList::ItemList方法的典型用法代碼示例。如果您正苦於以下問題:PHP ItemList::ItemList方法的具體用法?PHP ItemList::ItemList怎麽用?PHP ItemList::ItemList使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ItemList
的用法示例。
在下文中一共展示了ItemList::ItemList方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: SearchItemList
function SearchItemList($query = null, $results = 0)
{
parent::ItemList();
if ($query) {
$this->query = $query;
} elseif (isset($_REQUEST[QUERY_PRM])) {
$this->query = $_REQUEST[QUERY_PRM];
} else {
$this->query = null;
}
// Sanitize the query parameters:
// fixme: this probably breaks on queries with weird characters, depending
// on the locale.
// see: http://php.benscom.com/manual/en/reference.pcre.pattern.syntax.php
if ($this->query) {
$this->query = trim(preg_replace('#[^\\w\\s\\x80-\\xff]#', '', $this->query));
}
$this->resultsPerPage = (int) $results;
$this->populate();
$this->humanReadableQuery = implode(" " . strtoupper($this->logicSep) . " ", $this->searchTerms);
}
示例2: PaginatedItemList
function PaginatedItemList($itemsPerPage = null)
{
parent::ItemList();
if (isset($_REQUEST['page'])) {
$this->page = sanitize($_REQUEST['page'], RSS_SANITIZER_NUMERIC);
} else {
$this->page = 0;
}
if ($itemsPerPage === null) {
$this->itemsPerPage = getConfig('rss.output.frontpage.numitems');
} else {
$this->itemsPerPage = $itemsPerPage;
}
if ($this->itemsPerPage <= 0) {
$this->itemsPerPage = 50;
}
}