本文整理匯總了PHP中Versions::list_selected方法的典型用法代碼示例。如果您正苦於以下問題:PHP Versions::list_selected方法的具體用法?PHP Versions::list_selected怎麽用?PHP Versions::list_selected使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Versions
的用法示例。
在下文中一共展示了Versions::list_selected方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: list_by_date_for_anchor
/**
* list most recent versions for one anchor
*
* @param string the target anchor
* @param int the offset from the start of the list; usually, 0 or 1
* @param int the number of items to display
* @param string the list variant, if any
* @return NULL on error, else an ordered array with $url => ($prefix, $label, $suffix, $icon)
*
* @see versions/list.php
*/
public static function list_by_date_for_anchor($anchor, $offset = 0, $count = 10, $variant = NULL)
{
global $context;
// locate where we are
if (!isset($variant)) {
$variant = $anchor;
}
// the list of versions
$query = "SELECT * FROM " . SQL::table_name('versions') . " AS versions" . " WHERE (anchor LIKE '" . SQL::escape($anchor) . "')" . " ORDER BY versions.edit_date DESC LIMIT " . $offset . ',' . $count;
$output = Versions::list_selected(SQL::query($query), $variant);
return $output;
}