Renders values as a PDF

@param string|ModelInterface|PdfModel $nameOrModel
@param  null|array|\ArrayAccess Values to use during rendering
@return string The script output.
430787
public function render($nameOrModel, $values = null)
    {
        $pdfOptions         = $nameOrModel->getPdfOptions();
        $paperSize          = explode(',', $pdfOptions->getPaperSize());
        $paperOrientation   = $pdfOptions->getPaperOrientation();
        $basePath           = $pdfOptions->getBasePath();

        $paperSize          = (count($paperSize) === 1) ? $paperSize[0] : $paperSize;
        
        $pdf = $this->getEngine();
        $pdf->setPaper($paperSize, $paperOrientation);
        $pdf->setBasePath($basePath);

        $html = $this->getHtmlRenderer()->render($nameOrModel, $values);

        $pdf->loadHtml($html);
        $pdf->render();

        $pdf = $this->processHeader($pdf, $pdfOptions);
        $pdf = $this->processFooter($pdf, $pdfOptions);

        return $pdf->output();
    }
1241122
public function render()
    {
        $nameAttribute = $this->getName();
        $this->registerFieldNameForFormTokenGeneration($nameAttribute);

        $output = '';
        $resource = $this->getUploadedResource();
        if ($resource !== null) {
            $resourceIdentityAttribute = '';
            if ($this->hasArgument('id')) {
                $resourceIdentityAttribute = ' id="' . htmlspecialchars($this->arguments['id']) . '-resource-identity"';
            }
            $output .= '<input type="hidden" name="'. htmlspecialchars($nameAttribute) . '[originallySubmittedResource][__identity]" value="' . $this->persistenceManager->getIdentifierByObject($resource) . '"' . $resourceIdentityAttribute . ' />';
        }

        if ($this->hasArgument('collection') && $this->arguments['collection'] !== false && $this->arguments['collection'] !== '') {
            $output .= '<input type="hidden" name="'. htmlspecialchars($nameAttribute) . '[__collectionName]" value="' . htmlspecialchars($this->arguments['collection']) . '" />';
        }

        $this->tag->addAttribute('type', 'file');
        $this->tag->addAttribute('name', $nameAttribute);

        $this->addAdditionalIdentityPropertiesIfNeeded();
        $this->setErrorClassAttribute();

        $output .= $this->tag->render();
        return $output;
    }
1140376
private function renderHeaderFields($parentModel, EnvironmentInterface $environment)
    {
        $definition = $environment->getDataDefinition();
        $parentName = $definition->getBasicDefinition()->getParentDataProvider();
        $add        = [];
        $properties = $environment->getParentDataDefinition()->getPropertiesDefinition();
        foreach ($this->getViewSection($definition)->getListingConfig()->getHeaderPropertyNames() as $field) {
            $value = StringUtil::deserialize($parentModel->getProperty($field));

            if ('tstamp' === $field) {
                $value = date(Config::get('datimFormat'), $value);
            } else {
                $value = $this->renderParentProperty($environment, $properties->getProperty($field), $value);
            }

            // Add the field.
            if ('' !== $value) {
                $add[$this->translateHeaderColumnName($field, $parentName)] = $value;
            }
        }

        $event = new GetParentHeaderEvent($environment, $parentModel);
        $event->setAdditional($add);

        $environment->getEventDispatcher()->dispatch(GetParentHeaderEvent::NAME, $event);

        if (null !== !$event->getAdditional()) {
            $add = $event->getAdditional();
        }

        return \array_map(
            function ($value) {
                if (\is_array($value)) {
                    return $value[0];
                }
                return $value;
            },
            $add
        );
    }
108239
protected function renderInlineAssignment($name, $value)
    {
        if ($value instanceof RawText) {
            $value = $value->getText();
        } else {
            $value = $this->escape($value);
        }

        return $this->escape($name).'='.$value;
    }
813212
public function render(Model $model, $source)
    {
        $source = $this->resolveModelSource($model, $source);

        if ( ! ($source instanceof AttachmentInterface)) {
            throw new UnexpectedValueException("Paperclip strategy expects Attachment as source");
        }

        $resize = $this->getVarianttoUse($source);

        if ($this->listColumnData) {
            $width  = array_get($this->listColumnData->options, 'width');
            $height = array_get($this->listColumnData->options, 'height');
        } else {
            $width  = null;
            $height = null;
        }

        return view(static::VIEW, [
            'exists'      => $source->size() > 0,
            'filename'    => $source->originalFilename(),
            'urlThumb'    => $source->url($resize),
            'urlOriginal' => $source->url(),
            'width'       => $width ?: $height ?: static::WIDTH,
            'height'      => $height ?: $width ?: static::HEIGHT,
        ]);
    }
671436
public function form($name, $model, $url)
    {

        $form = $this->form->of("antares.ui-components: custom", function (FormGrid $form) use ($name, $model, $url) {
            $form->name('Ui component form');
            $form->resource($this, $url, $model, ['class' => 'form--hor']);
            $form->hidden('id');
            $form->ajaxable([
                'afterValidate' => $this->afterValidateAdapter->afterValidate(handles('antares/ui-components::ui-components/' . $model->id))
            ]);
            $form->layout('antares/ui-components::admin.partials._form', ['id' => $model->id]);
        });
        $className = app('antares.memory')->make('ui-components')->get($name . '.name');
        app($className)->form();
        return $form;
    }
789003
protected function getModelValueAttribute($model, $name)
    {
        $transformedName = $this->transformKey($name);
        if (is_string($model)) {
            return $model;
        } elseif (is_object($model)) {
            return object_get($model, $transformedName);
        } elseif (is_array($model)) {
            return Arr::get($model, $transformedName);
        }
    }
603806
protected function renderStars($id,$name)
	{
		$inputCount=(int)(($this->maxRating-$this->minRating)/$this->ratingStepSize+1);
		$starSplit=(int)($inputCount/$this->starCount);
		if($this->hasModel())
		{
			$attr=$this->attribute;
			CHtml::resolveName($this->model,$attr);
			$selection=$this->model->$attr;
		}
		else
			$selection=$this->value;
		$options=$starSplit>1 ? array('class'=>"{split:{$starSplit}}") : array();
		for($value=$this->minRating, $i=0;$i<$inputCount; ++$i, $value+=$this->ratingStepSize)
		{
			$options['id']=$id.'_'.$i;
			$options['value']=$value;
			if(isset($this->titles[$value]))
				$options['title']=$this->titles[$value];
			else
				unset($options['title']);
			echo CHtml::radioButton($name,!strcmp($value,$selection),$options) . "\n";
		}
	}
1314969
protected function renderHtml($name = null, $data = []) {
        if (is_array($name)) {
            $data = $name;
            $name = null;
        }
        return $this->renderFile($this->getViewFile($name), $data);
    }
227010
public function render($name, $params = null, $options = null)
    {
        return $this->get($name, $options)->render($params);
    }
997487
public function render(FormInterface $oForm, $sFormLayout = parent::LAYOUT_HORIZONTAL)
    {
        //Prepare form if needed
        if (method_exists($oForm, 'prepare')) {
            $oForm->prepare();
        }
		
		$sFormClass = $sFormLayout;
		if($sFormLayout === self::LAYOUT_VALUES || $sFormLayout === self::LAYOUT_VALUES_HIDDEN){
			$sFormLayout = parent::LAYOUT_HORIZONTAL;
		}
        $this->setFormClass($oForm, $sFormLayout);

        //Set form role
        if (!$oForm->getAttribute('role')) {
            $oForm->setAttribute('role', 'form');
        }

        $bHasColumnSizes = false;
        $sFormContent = '';
		//----- EDIT
        //$oRenderer = $this->getView();
		$collectionHelper = $this->getCollectionHelper();
		$rowHelper = $this->getRowHelper();
		//----- END
        foreach ($oForm as $oElement) {
            $aOptions = $oElement->getOptions();
            if (!$bHasColumnSizes && !empty($aOptions['column-size'])) {
                $bHasColumnSizes = true;
            }
            //Define layout option to form elements if not already defined
            if ($sFormLayout && empty($aOptions['twb-layout'])) {
                $aOptions['twb-layout'] = $sFormLayout;
                $oElement->setOptions($aOptions);
            }
			if($sFormClass === self::LAYOUT_VALUES || $sFormClass === self::LAYOUT_VALUES_HIDDEN){
				if($sFormClass === self::LAYOUT_VALUES || !($oElement instanceof \Zend\Form\Element\Button || $oElement instanceof \Zend\Form\Element\Submit)){
					// render buttons in LAYOUT_VALUES_HIDDEN, but not in LAYOUT_VALUES
					$oElement->setOption('value_only', true);
					if($sFormClass === self::LAYOUT_VALUES_HIDDEN){
						$oElement->setOption('add_hidden', true);
					}
					if($oElement instanceof \Zend\Form\Element\Checkbox){
						$oElement->setAttribute('type', 'text');
					}
				}
			}
			//------- EDIT
            //$sFormContent .= $oElement instanceof FieldsetInterface ? $oRenderer->formCollection($oElement) : $oRenderer->formRow($oElement);
            $sFormContent .= $oElement instanceof FieldsetInterface ? $collectionHelper($oElement) : $rowHelper($oElement);
			//------- END
        }
        if ($bHasColumnSizes && $sFormLayout !== parent::LAYOUT_HORIZONTAL) {
            $sFormContent = sprintf(self::$formRowFormat, $sFormContent);
        }
        return $this->openTag($oForm) . $sFormContent . $this->closeTag();
    }
1362884
public function render($name, array $parameters = [])
    {
        $storage = $this->load($name);
        $key = hash('sha256', serialize($storage));
        $this->current = $key;
        $this->parents[$key] = null;

        // attach the global variables
        $parameters = array_replace($this->getGlobals(), $parameters);
        // render
        if (false === $content = $this->evaluate($storage, $parameters)) {
            throw new \RuntimeException(sprintf('The template "%s" cannot be rendered.', $this->parser->parse($name)));
        }

        // decorator
        if ($this->parents[$key]) {
            $slots = $this->get('slots');
            $this->stack[] = $slots->get('_content');
            $slots->set('_content', $content);

            $content = $this->render($this->parents[$key], $parameters);

            $slots->set('_content', array_pop($this->stack));
        }

        return $content;
    }
134549
protected function renderObjectWithCallback($chartOption, $name)
    {
        $result = "";

        if (get_object_vars($chartOption)) {
            // Zend\Json is used in place of json_encode to preserve JS anonymous functions
            $result .= $name . ": " . Json::encode($chartOption, false, array('enableJsonExprFinder' => true)) . ",\n";
        }

        return $result;
    }
1045616
public function get(string $namespace = null, string $service = null, string $method = null, int $version = null)
    {
        return $this->masterpage->render();
    }
725793
public function render($name, $data)
    {
        if (isset($data['value'])) {
            $value = $data['value'];
            unset($data['value']);
        } elseif (isset($data['name'])) {
            $value = $this->request->getInput($data['name'], '');
        } else {
            $value = null;
        }

        $method = '_render_' . $name;
        if (method_exists($this, $method)) {
            return $this->$method($data, $value);
        } else {
            throw new InvalidArgumentException(['`:type` type is not exist', 'type' => $name]);
        }
    }
404183
protected function renderArrayWithCallback($chartOption, $name)
    {
        $result = "";

        if (!empty($chartOption)) {
            // Zend\Json is used in place of json_encode to preserve JS anonymous functions
            $result .= $name . ": " . Json::encode($chartOption[0], false, array('enableJsonExprFinder' => true)) . ", \n";
        }

        return $result;
    }
908506
public function saveDocument(FileCreateOrUpdateEvent $event, FileModelInterface $documentModel)
    {
        return $this->saveFile($event->getParentId(), $documentModel);
    }