public function getHeaderCode(\mpf\widgets\datatable\Table $table)
    {
        $label = $this->getLabel();
        if (!$this->order) {
            return $label;
        }
        $order = $this->dataProvider->getOrder();
        $prefix = '';

        $this->iconArrowUp = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), ($this->iconSize . 'x' . $this->iconSize)), $this->iconArrowUp);
        $this->iconArrowDown = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), ($this->iconSize . 'x' . $this->iconSize)), $this->iconArrowDown);
        if ('%MPF_ASSETS%' == substr($this->iconArrowUp, 0, 12)) {
            $this->iconArrowUp = AssetsPublisher::get()->mpfAssetFile(substr($this->iconArrowUp, 12));
        }
        if ('%MPF_ASSETS%' == substr($this->iconArrowDown, 0, 12)) {
            $this->iconArrowDown = AssetsPublisher::get()->mpfAssetFile(substr($this->iconArrowDown, 12));
        }
        if ($order[0] == (is_string($this->order) ? $this->order : '`' . $this->name . '`')) {
            $prefix = ('ASC' == $order[1]) ? Html::get()->image($this->iconArrowUp, 'Order Descendent', ['class' => 'order-by-img']) : Html::get()->image($this->iconArrowDown, 'Order Ascendent', ['class' => 'order-by-img']);
        }
        return $this->dataProvider->getColumnOrderLink(is_string($this->order) ? $this->order : '`' . $this->name . '`', $prefix . $label);
    }
public function getHeaderCode(\mpf\widgets\datatable\Table $table)
    {
        $label = $this->getLabel();
        if (!$this->order) {
            return $label;
        }
        $order = $this->dataProvider->getOrder();
        $prefix = '';

        $this->iconArrowUp = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), ($this->iconSize . 'x' . $this->iconSize)), $this->iconArrowUp);
        $this->iconArrowDown = str_replace(array('%DATATABLE_ASSETS%', '%SIZE%'), array($table->getAssetsURL(), ($this->iconSize . 'x' . $this->iconSize)), $this->iconArrowDown);
        if ('%MPF_ASSETS%' == substr($this->iconArrowUp, 0, 12)) {
            $this->iconArrowUp = AssetsPublisher::get()->mpfAssetFile(substr($this->iconArrowUp, 12));
        }
        if ('%MPF_ASSETS%' == substr($this->iconArrowDown, 0, 12)) {
            $this->iconArrowDown = AssetsPublisher::get()->mpfAssetFile(substr($this->iconArrowDown, 12));
        }
        if ($order[0] == (is_string($this->order) ? $this->order : '`' . $this->name . '`')) {
            $prefix = ('ASC' == $order[1]) ? Html::get()->image($this->iconArrowUp, 'Order Descendent', ['class' => 'order-by-img']) : Html::get()->image($this->iconArrowDown, 'Order Ascendent', ['class' => 'order-by-img']);
        }
        return $this->dataProvider->getColumnOrderLink(is_string($this->order) ? $this->order : '`' . $this->name . '`', $prefix . $label);
    }
public function getHeaderCode ( \ mpf \ widgets \ datatable \ Table $ table ) { $ label = $ this -> getLabel ( ) ; if ( ! $ this -> order ) { return $ label ; } $ order = $ this -> dataProvider -> getOrder ( ) ; $ prefix = '' ; $ this -> iconArrowUp = str_replace ( array ( '%DATATABLE_ASSETS%' , '%SIZE%' ) , array ( $ table -> getAssetsURL ( ) , ( $ this -> iconSize . 'x' . $ this -> iconSize ) ) , $ this -> iconArrowUp ) ; $ this -> iconArrowDown = str_replace ( array ( '%DATATABLE_ASSETS%' , '%SIZE%' ) , array ( $ table -> getAssetsURL ( ) , ( $ this -> iconSize . 'x' . $ this -> iconSize ) ) , $ this -> iconArrowDown ) ; if ( '%MPF_ASSETS%' == substr ( $ this -> iconArrowUp , 0 , 12 ) ) { $ this -> iconArrowUp = AssetsPublisher :: get ( ) -> mpfAssetFile ( substr ( $ this -> iconArrowUp , 12 ) ) ; } if ( '%MPF_ASSETS%' == substr ( $ this -> iconArrowDown , 0 , 12 ) ) { $ this -> iconArrowDown = AssetsPublisher :: get ( ) -> mpfAssetFile ( substr ( $ this -> iconArrowDown , 12 ) ) ; } if ( $ order [ 0 ] == ( is_string ( $ this -> order ) ? $ this -> order : '`' . $ this -> name . '`' ) ) { $ prefix = ( 'ASC' == $ order [ 1 ] ) ? Html :: get ( ) -> image ( $ this -> iconArrowUp , 'Order Descendent' , [ 'class' => 'order-by-img' ] ) : Html :: get ( ) -> image ( $ this -> iconArrowDown , 'Order Ascendent' , [ 'class' => 'order-by-img' ] ) ; } return $ this -> dataProvider -> getColumnOrderLink ( is_string ( $ this -> order ) ? $ this -> order : '`' . $ this -> name . '`' , $ prefix . $ label ) ; }
Get HTML code for header
@param Table $table
@return string
Get HTML code for header