Return the current renderer.

@throws \Exception

@return \ZfcDatagrid\Renderer\AbstractRenderer
347759
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;
    }
245413
public function getAutomationRenderer()
    {
        $this->automationRenderer = $this->getLayout()->createBlock(
            \Dotdigitalgroup\Email\Block\Adminhtml\Config\Select::class,
            '',
            ['data' => ['is_render_to_js_template' => true]]
        );

        return $this->automationRenderer;
    }
1182121
public function render(array $arguments = [], $renderer = null) {
        if($renderer === null) {
            if(static::$defaultRenderer === null) {
                throw new Exception('No Default Renderer Exists for Class ' . get_class());
            } else {
                if(is_callable(static::$defaultRenderer)) {
                    $callable = static::$defaultRenderer;
                    static::$defaultRenderer = $callable();
                }
                $renderer = static::$defaultRenderer;
            }
        } else {
            if(is_callable($renderer)) {
                $renderer = $renderer();
            }
        }

        return $renderer->render($this, $arguments);
    }
1329177
public function current()
    {
        $row = $this->zfResultSet->current();
        if ($row === null) {
            return null;
        }

        if (!$this->hydrate_options_initialized) {
            $this->initColumnModelHydration($row);
        }

        // 1. Row renderers
        foreach ($this->hydration_renderers as $renderer) {
            $renderer->apply($row);
        }

        // 2. Formatters
        foreach ($this->hydration_formatters as $formatters) {
            foreach ($formatters['columns'] as $column) {
                $row[$column] = $formatters['formatter']->format($row[$column], $row);
            }
        }

        // 3. Process column hydration
        if ($this->hydrated_columns !== null) {
            $d = new ArrayObject();
            foreach ($this->hydrated_columns as $column) {
                $d->offsetSet($column, isset($row[$column]) ? $row[$column] : null);
            }
            $row->exchangeArray($d);
        }

        if ($this->returnType === self::TYPE_ARRAY) {
            return (array) $row;
        }

        return $row;
    }
770665
public function render()
    {
        if (!$this->grid->usePagination()) {
            return '';
        }

        return $this->paginationRanger().
            $this->paginationLinks().
            $this->perPageSelector();
    }
683445
@Programmatic
    public Renderer newRenderer() {
        final Renderer renderer = (Renderer) classService.instantiate(getRendererClassName());
        serviceRegistry2.injectServicesInto(renderer);
        return renderer;
    }
171699
public function render(array $arguments = [], $renderer = null) {
        if(!$this->getMeta()->editable) {
            throw new Exception('Field "' . $this->getMeta()->name . '" is not editable');
        }

        $type = $this->getMeta()->type;
        if($renderer === null) {
            if(!isset(static::$renderers[$type])) {
                if(static::$fallbackRenderer === null) {
                    throw new Exception('No Default Renderer Exists for Class "' . get_class() . '"');
                }
                $renderer = static::$fallbackRenderer;
            } else {
                if(is_callable(static::$renderers[$type])) {
                    $callable = static::$renderers[$type];
                    static::$renderers[$type] = $callable();
                }
                $renderer = static::$renderers[$type];
            }
        } else {
            if(is_callable($renderer)) {
                $renderer = $renderer();
            }
        }

        return $renderer->render($this, $arguments);
    }
1353804
protected function getActionRenderer()
    {
        $obj = null;
        if ($this instanceof FormSidebarInterface) {
            if ($this->form()) {
                $obj = $this->form()->obj();
            }
        }

        if ($this instanceof ObjectContainerInterface) {
            $obj = $this->obj();
        }

        if ($this instanceof CollectionContainerInterface) {
            $obj = isset($this->currentObj) ? $this->currentObj : $this->proto();
        }

        return $obj instanceof ViewableInterface ? $obj : null;
    }
225534
public function getRenderer()
    {
        $locator = $this->getServiceLocator();
        if (null === $this->renderer && $locator->has(Renderer\RendererInterface::class)) {
            $this->setRenderer($locator->get(Renderer\RendererInterface::class));
        }

        return $this->renderer;
    }
227938
public function render()
    {
        $iter = $this->getIterator();
        foreach ($iter as $this->current_id => $this->current_row) {
            if ($this->current_row instanceof Model || $this->current_row instanceof \atk4\data\Model) {
                /** @type Model $this->current_row */
                $this->current_row = $this->current_row->get();
            } elseif (!is_array($this->current_row) && !($this->current_row instanceof ArrayAccess)) {
                // Looks like we won't be able to access current_row as array, so we will
                // copy it's value inside $this->current instead and produce an empty array
                // to be filled out by a custom iterators
                $this->current = $this->current_row;
                $this->current_row = get_object_vars($this->current);
            }

            $this->formatRow();
            $this->output($this->rowRender($this->template));
        }
    }
105504
public function getStatusRenderer()
    {
        $this->statusRenderer = $this->getLayout()->createBlock(
            \Dotdigitalgroup\Email\Block\Adminhtml\Config\Select::class,
            '',
            ['data' => ['is_render_to_js_template' => true]]
        );

        return $this->statusRenderer;
    }
1344649
protected function getDisplayerClass()
    {
        $class = $this->wrappedObject->revisionable_type;

        do {
            if (class_exists($displayer = $this->generateDisplayerName($class))) {
                return $displayer;
            }
        } while ($class = get_parent_class($class));

        throw new Exception('No displayers could be found');
    }
352104
public function with()
    {
        $methodArguments = new MethodArguments();
        $this->currentWith = $methodArguments->getMethodArgumentValues(
            func_get_args(),
            $this->getClassName() . "::" . $this->currentRules[0]
        );
        foreach ($this->currentRules as $rule) {
            if ($this->rules[$rule][md5('null')]['hasSetTimes']) {
                $renderer = new ValueRenderer();
                $converter = new NumberToTimesConverter();
                $args = $renderer->renderAll($this->currentWith);
                $times = $this->rules[$rule][md5('null')]['times'];
                $convertToMethod = $converter->convertToMethod($times);
                throw new Exception(
                    sprintf(
                        "%s:\n  ->expects('%s')->with(%s)->%s",
                        "When using with you must specify expectations for each with()",
                        $rule,
                        $args,
                        $convertToMethod
                    )
                );
            }
            $this->rules[$rule][md5('null')]['times'] = -1;
        }
        $this->setupWith(
            new Action\ReturnValueAction(array(null)),
            $this->isExpecting ? 1 : -1
        );

        return $this;
    }
947639
protected function doRender()
    {
        list($resource, $parameters) = $this->getCurrent();

        ob_start();
        try {

            if ($resource instanceof FileResource) {
                $this->displayFile($resource, $parameters);
            } elseif ($resource instanceof StringResource) {
                $this->displayString($resource, $parameters);
            }

        } catch (\Exception $e) {
            ob_end_clean();

            if ($e instanceof TemplateException) {
                throw $e;
            }

            throw new RenderException($e->getMessage(), $e, $e->getCode());
        }

        return ob_get_clean();
    }
522383
public function render($exception)
    {
        for ($level = ob_get_level(); $level > 0; $level--) {
            ob_end_clean();
        }

        if ($this->configure->debug) {
            if ($this->renderer->exists('@views/Errors/debug')) {
                return $this->renderer->render('@views/Errors/debug', ['exception' => $exception]);
            } else {
                return $this->renderer->render('@manaphp/Mvc/ErrorHandler/Views/debug', ['exception' => $exception]);
            }
        }

        $statusCode = $exception instanceof \ManaPHP\Exception ? $exception->getStatusCode() : 500;

        foreach (["@views/Errors/$statusCode",
                     '@views/Errors/error'] as $template) {
            if ($this->renderer->exists($template)) {
                return $this->renderer->render($template, ['statusCode' => $statusCode, 'exception' => $exception]);
            }
        }
        $status = $this->response->getStatus();
        return "<html lang='en'><title>$status</title><body>$status</body></html>";
    }
907619
public function toString()
    {
        if (!$this->_renderer || !$this->_renderer->canRender($this)) {
            return '';
        }

        return $this->_renderer->render($this);
    }
870808
public function render(AbstractRenderer $renderer = null, $active = null)
    {
        if (is_null($renderer)) {
            $renderer = $this->getRenderer();
        }

        return $renderer->render($this->getRelations(), $active);
    }