public function sortDir($model = null, array $options = [])
    {
        $dir = null;

        if (empty($options)) {
            $options = $this->params($model);
        }

        if (isset($options['direction'])) {
            $dir = strtolower($options['direction']);
        }

        if ($dir === 'desc') {
            return 'desc';
        }

        return 'asc';
    }
public function sortDir($model = null, array $options = [])
    {
        $dir = null;

        if (empty($options)) {
            $options = $this->params($model);
        }

        if (isset($options['direction'])) {
            $dir = strtolower($options['direction']);
        }

        if ($dir === 'desc') {
            return 'desc';
        }

        return 'asc';
    }
public function sortDir ( $ model = null , array $ options = [ ] ) { $ dir = null ; if ( empty ( $ options ) ) { $ options = $ this -> params ( $ model ) ; } if ( isset ( $ options [ 'direction' ] ) ) { $ dir = strtolower ( $ options [ 'direction' ] ) ; } if ( $ dir === 'desc' ) { return 'desc' ; } return 'asc' ; }
Gets the current direction the recordset is sorted

@param string|null $model Optional model name. Uses the default if none is specified.
@param array $options Options for pagination links. See #options for list of keys.
@return string The direction by which the recordset is being sorted, or
null if the results are not currently sorted.
@link https://book.cakephp.org/3.0/en/views/helpers/paginator.html#creating-sort-links
Gets the current direction the recordset is sorted