本文整理汇总了PHP中K2HelperHTML::sorting方法的典型用法代码示例。如果您正苦于以下问题:PHP K2HelperHTML::sorting方法的具体用法?PHP K2HelperHTML::sorting怎么用?PHP K2HelperHTML::sorting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类K2HelperHTML
的用法示例。
在下文中一共展示了K2HelperHTML::sorting方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setFilters
protected function setFilters()
{
// Sorting filter
$sortingOptions = array('K2_NONE' => 'ordering', 'K2_ID_ASC' => 'id', 'K2_ID_DESC' => 'id.reverse', 'K2_TITLE_ASC' => 'title', 'K2_TITLE_DESC' => 'title.reverse');
K2Response::addFilter('sorting', JText::_('K2_SORT_BY'), K2HelperHTML::sorting($sortingOptions), false, 'header');
// Search filter
K2Response::addFilter('search', JText::_('K2_SEARCH'), K2HelperHTML::search(), false, 'sidebar');
}
示例2: setFilters
protected function setFilters()
{
// Type filter
K2Response::addFilter('type', JText::_('K2_TYPE'), K2HelperHTML::extraFieldsTypes('type', null, 'K2_ANY'), false, 'header');
// Group filter
K2Response::addFilter('group', JText::_('K2_GROUP'), K2HelperHTML::extraFieldsGroups('group', null, 'K2_ANY'), false, 'header');
// Sorting filter
$sortingOptions = array('K2_NONE' => '', 'K2_ID_ASC' => 'id', 'K2_ID_DESC' => 'id.reverse', 'K2_NAME_ASC' => 'name', 'K2_NAME_DESC' => 'name.reverse', 'K2_GROUP_ASC' => 'group', 'K2_GROUP_DESC' => 'group.reverse', 'K2_TYPE_ASC' => 'type', 'K2_TYPE_DESC' => 'type.reverse', 'K2_ORDERING' => 'ordering', 'K2_STATE_ASC' => 'state', 'K2_STATE_DESC' => 'state.reverse');
K2Response::addFilter('sorting', JText::_('K2_SORT_BY'), K2HelperHTML::sorting($sortingOptions), false, 'header');
// Search filter
K2Response::addFilter('search', JText::_('K2_SEARCH'), K2HelperHTML::search(), false, 'sidebar');
// State filter
K2Response::addFilter('state', JText::_('K2_STATE'), K2HelperHTML::state('state', null, 'K2_ANY', false), true, 'sidebar');
}