FOF30\Template\Template::sefSort PHP Method

sefSort() public method

Creates a SEF compatible sort header. Standard Joomla function will add a href="#" tag, so with SEF enabled, the browser will follow the fake link instead of processing the onSubmit event; so we need a fix.
public sefSort ( string $text, string $field, stdClass $list ) : string
$text string Header text
$field string Field used for sorting
$list stdClass Object holding the direction and the ordering field
return string HTML code for sorting
    public function sefSort($text, $field, $list)
    {
        $sort = \JHTML::_('grid.sort', \JText::_(strtoupper($text)) . ' ', $field, $list->order_Dir, $list->order);
        return str_replace('href="#"', 'href="javascript:void(0);"', $sort);
    }