public function getRenderer()
    {
        if (null === $this->renderer) {
            if (isset($this->rendererService)) {
                $renderer = $this->rendererService;
                if (! $renderer instanceof Renderer\AbstractRenderer) {
                    throw new \Exception(
                        'Renderer service must implement "ZfcDatagrid\Renderer\AbstractRenderer"'
                    );
                }
                $renderer->setOptions($this->getOptions());
                $renderer->setMvcEvent($this->getMvcEvent());
                if ($this->getToolbarTemplate() !== null) {
                    $renderer->setToolbarTemplate($this->getToolbarTemplate());
                }
                $renderer->setToolbarTemplateVariables($this->getToolbarTemplateVariables());
                $renderer->setViewModel($this->getViewModel());
                if ($this->hasTranslator()) {
                    $renderer->setTranslator($this->getTranslator());
                }
                $renderer->setTitle($this->getTitle());
                $renderer->setColumns($this->getColumns());
                $renderer->setRowStyles($this->getRowStyles());
                $renderer->setCache($this->getCache());
                $renderer->setCacheId($this->getCacheId());

                $this->renderer = $renderer;
            } else {
                throw new \Exception(
                    sprintf(
                        'Renderer service was not found, please register it: "zfcDatagrid.renderer.%s"',
                        $this->getRendererName()
                    )
                );
            }
        }

        return $this->renderer;
    }
public function getRenderer()
    {
        if (null === $this->renderer) {
            if (isset($this->rendererService)) {
                $renderer = $this->rendererService;
                if (! $renderer instanceof Renderer\AbstractRenderer) {
                    throw new \Exception(
                        'Renderer service must implement "ZfcDatagrid\Renderer\AbstractRenderer"'
                    );
                }
                $renderer->setOptions($this->getOptions());
                $renderer->setMvcEvent($this->getMvcEvent());
                if ($this->getToolbarTemplate() !== null) {
                    $renderer->setToolbarTemplate($this->getToolbarTemplate());
                }
                $renderer->setToolbarTemplateVariables($this->getToolbarTemplateVariables());
                $renderer->setViewModel($this->getViewModel());
                if ($this->hasTranslator()) {
                    $renderer->setTranslator($this->getTranslator());
                }
                $renderer->setTitle($this->getTitle());
                $renderer->setColumns($this->getColumns());
                $renderer->setRowStyles($this->getRowStyles());
                $renderer->setCache($this->getCache());
                $renderer->setCacheId($this->getCacheId());

                $this->renderer = $renderer;
            } else {
                throw new \Exception(
                    sprintf(
                        'Renderer service was not found, please register it: "zfcDatagrid.renderer.%s"',
                        $this->getRendererName()
                    )
                );
            }
        }

        return $this->renderer;
    }
public function getRenderer ( ) { if ( null === $ this -> renderer ) { if ( isset ( $ this -> rendererService ) ) { $ renderer = $ this -> rendererService ; if ( ! $ renderer instanceof Renderer \ AbstractRenderer ) { throw new \ Exception ( 'Renderer service must implement "ZfcDatagrid\Renderer\AbstractRenderer"' ) ; } $ renderer -> setOptions ( $ this -> getOptions ( ) ) ; $ renderer -> setMvcEvent ( $ this -> getMvcEvent ( ) ) ; if ( $ this -> getToolbarTemplate ( ) !== null ) { $ renderer -> setToolbarTemplate ( $ this -> getToolbarTemplate ( ) ) ; } $ renderer -> setToolbarTemplateVariables ( $ this -> getToolbarTemplateVariables ( ) ) ; $ renderer -> setViewModel ( $ this -> getViewModel ( ) ) ; if ( $ this -> hasTranslator ( ) ) { $ renderer -> setTranslator ( $ this -> getTranslator ( ) ) ; } $ renderer -> setTitle ( $ this -> getTitle ( ) ) ; $ renderer -> setColumns ( $ this -> getColumns ( ) ) ; $ renderer -> setRowStyles ( $ this -> getRowStyles ( ) ) ; $ renderer -> setCache ( $ this -> getCache ( ) ) ; $ renderer -> setCacheId ( $ this -> getCacheId ( ) ) ; $ this -> renderer = $ renderer ; } else { throw new \ Exception ( sprintf ( 'Renderer service was not found, please register it: "zfcDatagrid.renderer.%s"' , $ this -> getRendererName ( ) ) ) ; } } return $ this -> renderer ; }
Return the current renderer.

@throws \Exception

@return \ZfcDatagrid\Renderer\AbstractRenderer
Return the current renderer .