dudapiotr / ZfTable

*Not supported*ZfTable 3.1. Awesome ZF2 table / grid (and much much more) generator with huge possibilities of decorating and conditioning. Integrated with DataTables, Doctrine 2, Bootstrap 2.0 and 3.0.
http://dudapiotrek.laohost.net/
MIT License
75 stars 59 forks source link

Link decorator not compatible with Doctrine #75

Open cbichis opened 9 years ago

cbichis commented 9 years ago

Hi,

The link decorator is not compatible with Doctrine.

The code should be updated to something similar with:

    public function render($context) {
        $values = array();
        if (count($this->vars)) {
            $actualRow = $this->getCell()->getActualRow();

            foreach ($this->vars as $var) {
                if (is_object($actualRow)) {
                    $method = 'get' . ucfirst($var);
                    $values[] = $actualRow->$method();
                } else {
                    $values[] = $actualRow[$var];
                }
            }
        }
        $url = vsprintf($this->url, $values);
        return sprintf('<a  href="%s">%s</a>', $url, $context);
    }