src/Html/HasOptions.php
public function orderBy($index, $direction = 'desc')
    {
        if ($direction != 'desc') {
            $direction = 'asc';
        }

        if (is_array($index)) {
            $this->attributes['order'][] = $index;
        } else {
            $this->attributes['order'][] = [$index, $direction];
        }

        return $this;
    }
public function orderBy($index, $direction = 'desc')
    {
        if ($direction != 'desc') {
            $direction = 'asc';
        }

        if (is_array($index)) {
            $this->attributes['order'][] = $index;
        } else {
            $this->attributes['order'][] = [$index, $direction];
        }

        return $this;
    }
public function orderBy ( $ index , $ direction = 'desc' ) { if ( $ direction != 'desc' ) { $ direction = 'asc' ; } if ( is_array ( $ index ) ) { $ this -> attributes [ 'order' ] [ ] = $ index ; } else { $ this -> attributes [ 'order' ] [ ] = [ $ index , $ direction ] ; } return $ this ; }
Order option builder.

@param int|array $index
@param string $direction
@return $this
@see https://datatables.net/reference/option/order
Order option builder .