public function getString($row, Table $table) {
        if (!$this->isVisible($row)) {
            return "";
        }
        $options = $this->htmlOptions;
        if ($this->title != "") {
            eval("\$options['title'] = {$this->title};");
        } elseif (!isset($options['title'])) {
            $options['title'] = '';
        }
        if ($this->confirmation && (!$this->post)) {
            if ($this->jsAction) {
                $options['onclick'] = "if (confirm('{$this->confirmation}')) {$this->jsAction}({$row->{$this->dataProvider->getPkKey()}}, '{$this->name}', this);";
            } else {
                $options['onclick'] = "return confirm('{$this->confirmation}');";
            }
        } elseif ($this->jsAction) {
            $options['onclick'] = "return {$this->jsAction}({$row->id}, '{$this->name}', this);";
        }

        if ('#' != $this->url) {
            eval("\$url = {$this->url};");
        } else {
            $url = '#';
        }
        if (false !== $this->post && is_array($this->post)) {
            $options['class'] = isset($options['class']) ? $options['class'] . ' mdata-table-post-link' : 'mdata-table-post-link';
            $parsed = array();
            foreach ($this->post as $name=>$value){
                eval('$value = '. $value.';');
                if ('{{modelKey}}' == $name){
                    $name = $table->dataProvider->filtersKey;
                }
                $parsed[$name] = $value;
            }
            $options['post-data'] = json_encode($parsed);
            if ($this->confirmation){
                $options['post-confirmation'] = $this->confirmation;
            }
        }
        $icon = $this->getIcon($options['title'], $table);
        return Html::get()->link($url, $icon . $this->label, $options);
    }
public function getString($row, Table $table) {
        if (!$this->isVisible($row)) {
            return "";
        }
        $options = $this->htmlOptions;
        if ($this->title != "") {
            eval("\$options['title'] = {$this->title};");
        } elseif (!isset($options['title'])) {
            $options['title'] = '';
        }
        if ($this->confirmation && (!$this->post)) {
            if ($this->jsAction) {
                $options['onclick'] = "if (confirm('{$this->confirmation}')) {$this->jsAction}({$row->{$this->dataProvider->getPkKey()}}, '{$this->name}', this);";
            } else {
                $options['onclick'] = "return confirm('{$this->confirmation}');";
            }
        } elseif ($this->jsAction) {
            $options['onclick'] = "return {$this->jsAction}({$row->id}, '{$this->name}', this);";
        }

        if ('#' != $this->url) {
            eval("\$url = {$this->url};");
        } else {
            $url = '#';
        }
        if (false !== $this->post && is_array($this->post)) {
            $options['class'] = isset($options['class']) ? $options['class'] . ' mdata-table-post-link' : 'mdata-table-post-link';
            $parsed = array();
            foreach ($this->post as $name=>$value){
                eval('$value = '. $value.';');
                if ('{{modelKey}}' == $name){
                    $name = $table->dataProvider->filtersKey;
                }
                $parsed[$name] = $value;
            }
            $options['post-data'] = json_encode($parsed);
            if ($this->confirmation){
                $options['post-confirmation'] = $this->confirmation;
            }
        }
        $icon = $this->getIcon($options['title'], $table);
        return Html::get()->link($url, $icon . $this->label, $options);
    }
public function getString ( $ row , Table $ table ) { if ( ! $ this -> isVisible ( $ row ) ) { return "" ; } $ options = $ this -> htmlOptions ; if ( $ this -> title != "" ) { eval ( "\$options['title'] = {$this->title};" ) ; } elseif ( ! isset ( $ options [ 'title' ] ) ) { $ options [ 'title' ] = '' ; } if ( $ this -> confirmation && ( ! $ this -> post ) ) { if ( $ this -> jsAction ) { $ options [ 'onclick' ] = "if (confirm('{$this->confirmation}')) {$this->jsAction}({$row->{$this->dataProvider->getPkKey()}}, '{$this->name}', this);" ; } else { $ options [ 'onclick' ] = "return confirm('{$this->confirmation}');" ; } } elseif ( $ this -> jsAction ) { $ options [ 'onclick' ] = "return {$this->jsAction}({$row->id}, '{$this->name}', this);" ; } if ( '#' != $ this -> url ) { eval ( "\$url = {$this->url};" ) ; } else { $ url = '#' ; } if ( false !== $ this -> post && is_array ( $ this -> post ) ) { $ options [ 'class' ] = isset ( $ options [ 'class' ] ) ? $ options [ 'class' ] . ' mdata-table-post-link' : 'mdata-table-post-link' ; $ parsed = array ( ) ; foreach ( $ this -> post as $ name => $ value ) { eval ( '$value = ' . $ value . ';' ) ; if ( '{{modelKey}}' == $ name ) { $ name = $ table -> dataProvider -> filtersKey ; } $ parsed [ $ name ] = $ value ; } $ options [ 'post-data' ] = json_encode ( $ parsed ) ; if ( $ this -> confirmation ) { $ options [ 'post-confirmation' ] = $ this -> confirmation ; } } $ icon = $ this -> getIcon ( $ options [ 'title' ] , $ table ) ; return Html :: get ( ) -> link ( $ url , $ icon . $ this -> label , $ options ) ; }
Final result, a HTML Element for current action;
@param Model $row
@param \mpf\widgets\datatable\Table $table
@return string
Final result a HTML Element for current action ;