Render the field

@param mixed $print

@return string|void
19443
public function render( $print = true )
	{
		if( $this->args['render'] === false )return;

		$field = $this->getField();

		$class  = 'glsr-field';
		$class .= $this->args['errors'] ? ' glsr-has-error' : '';

		$renderedString = '%s';

		if( ( isset( $field->args['required'] ) && $field->args['required'] )
			|| ( isset( $field->args['attributes']['required'] ) || in_array( 'required', $field->args['attributes'] )) ) {
			$class .= ' glsr-required';
		}

		if( $field->args['type'] !== 'hidden' ) {
			$renderedString = sprintf( '<div class="%s">%%s</div>', $class );
		}

		$rendered = sprintf( $renderedString,
			$this->args['before'] .
			$field->generateLabel() .
			$field->render() .
			$this->args['after'] .
			$this->args['errors']
		);

		$rendered = apply_filters( 'castor/rendered/field', $rendered, $field->args['type'] );

		if( !!$print && $print !== 'return' ) {
			echo $rendered;
		}

		return $rendered;
	}
854982
public function render()
    {
        $this->saveLocale();
        $options = $this->options;

        $logOutputFile = $options->getLogOutputFile();
        if ($logOutputFile) {
            if (!file_exists($logOutputFile) && is_writable(dirname($logOutputFile))) {
                touch($logOutputFile);
            }

            $this->startTime = microtime(true);
            if (is_writable($logOutputFile)) {
                ob_start();
            }
        }

        $this->processHtml();

        $this->css->apply_styles($this->tree);

        // @page style rules : size, margins
        $pageStyles = $this->css->get_page_styles();
        $basePageStyle = $pageStyles["base"];
        unset($pageStyles["base"]);

        foreach ($pageStyles as $pageStyle) {
            $pageStyle->inherit($basePageStyle);
        }

        $defaultOptionPaperSize = $this->getPaperSize($options->getDefaultPaperSize());
        // If there is a CSS defined paper size compare to the paper size used to create the canvas to determine a
        // recreation need
        if (is_array($basePageStyle->size)) {
            $basePageStyleSize = $basePageStyle->size;
            $this->setPaper(array(0, 0, $basePageStyleSize[0], $basePageStyleSize[1]));
        }

        $paperSize = $this->getPaperSize();
        if (
            $defaultOptionPaperSize[2] !== $paperSize[2] ||
            $defaultOptionPaperSize[3] !== $paperSize[3] ||
            $options->getDefaultPaperOrientation() !== $this->paperOrientation
        ) {
            $this->setCanvas(CanvasFactory::get_instance($this, $this->paperSize, $this->paperOrientation));
            $this->fontMetrics->setCanvas($this->getCanvas());
        }

        $canvas = $this->getCanvas();

        if ($options->isFontSubsettingEnabled() && $canvas instanceof CPDF) {
            foreach ($this->tree->get_frames() as $frame) {
                $style = $frame->get_style();
                $node = $frame->get_node();

                // Handle text nodes
                if ($node->nodeName === "#text") {
                    $chars = mb_strtoupper($node->nodeValue) . mb_strtolower($node->nodeValue);
                    $canvas->register_string_subset($style->font_family, $chars);
                    continue;
                }

                // Handle generated content (list items)
                if ($style->display === "list-item") {
                    $chars = ListBullet::get_counter_chars($style->list_style_type);
                    $canvas->register_string_subset($style->font_family, $chars);
                    $canvas->register_string_subset($style->font_family, '.');
                    continue;
                }

                // Handle other generated content (pseudo elements)
                // FIXME: This only captures the text of the stylesheet declaration,
                //        not the actual generated content, and forces all possible counter
                //        values. See notes in issue #750.
                if ($frame->get_node()->nodeName == "dompdf_generated") {
                    // all possible counter values, just in case
                    $chars = ListBullet::get_counter_chars('decimal');
                    $canvas->register_string_subset($style->font_family, $chars);
                    $chars = ListBullet::get_counter_chars('upper-alpha');
                    $canvas->register_string_subset($style->font_family, $chars);
                    $chars = ListBullet::get_counter_chars('lower-alpha');
                    $canvas->register_string_subset($style->font_family, $chars);
                    $chars = ListBullet::get_counter_chars('lower-greek');
                    $canvas->register_string_subset($style->font_family, $chars);

                    // the hex-decoded text of the content property, duplicated from AbstrctFrameReflower::_parse_string
                    $decoded_string = preg_replace_callback("/\\\\([0-9a-fA-F]{0,6})/",
                        function ($matches) { return \Dompdf\Helpers::unichr(hexdec($matches[1])); },
                        $style->content);
                    $chars = mb_strtoupper($style->content) . mb_strtolower($style->content) . mb_strtoupper($decoded_string) . mb_strtolower($decoded_string);
                    $canvas->register_string_subset($style->font_family, $chars);
                    continue;
                }
            }
        }

        $root = null;

        foreach ($this->tree->get_frames() as $frame) {
            // Set up the root frame
            if (is_null($root)) {
                $root = Factory::decorate_root($this->tree->get_root(), $this);
                continue;
            }

            // Create the appropriate decorators, reflowers & positioners.
            Factory::decorate_frame($frame, $this, $root);
        }

        // Add meta information
        $title = $this->dom->getElementsByTagName("title");
        if ($title->length) {
            $canvas->add_info("Title", trim($title->item(0)->nodeValue));
        }

        $metas = $this->dom->getElementsByTagName("meta");
        $labels = array(
            "author" => "Author",
            "keywords" => "Keywords",
            "description" => "Subject",
        );
        /** @var \DOMElement $meta */
        foreach ($metas as $meta) {
            $name = mb_strtolower($meta->getAttribute("name"));
            $value = trim($meta->getAttribute("content"));

            if (isset($labels[$name])) {
                $canvas->add_info($labels[$name], $value);
                continue;
            }

            if ($name === "dompdf.view" && $this->parseDefaultView($value)) {
                $canvas->set_default_view($this->defaultView, $this->defaultViewOptions);
            }
        }

        $root->set_containing_block(0, 0,$canvas->get_width(), $canvas->get_height());
        $root->set_renderer(new Renderer($this));

        // This is where the magic happens:
        $root->reflow();

        // Clean up cached images
        Cache::clear();

        global $_dompdf_warnings, $_dompdf_show_warnings;
        if ($_dompdf_show_warnings && isset($_dompdf_warnings)) {
            echo '<b>Dompdf Warnings</b><br><pre>';
            foreach ($_dompdf_warnings as $msg) {
                echo $msg . "\n";
            }

            if ($canvas instanceof CPDF) {
                echo $canvas->get_cpdf()->messages;
            }
            echo '</pre>';
            flush();
        }

        if ($logOutputFile && is_writable($logOutputFile)) {
            $this->write_log();
            ob_end_clean();
        }

        $this->restoreLocale();
    }
445666
public function render()
    {
        parent::render();

        $soxId = $this->getEditObjectId();

        // all usergroups
        $oGroups = oxNew(\OxidEsales\Eshop\Core\Model\ListModel::class);
        $oGroups->init('oxgroups');
        $oGroups->selectString("select * from " . getViewName("oxgroups", $this->_iEditLang));

        $oRoot = new stdClass();
        $oRoot->oxgroups__oxid = new \OxidEsales\Eshop\Core\Field("");
        $oRoot->oxgroups__oxtitle = new \OxidEsales\Eshop\Core\Field("-- ");
        // rebuild list as we need the "no value" entry at the first position
        $aNewList = [];
        $aNewList[] = $oRoot;

        foreach ($oGroups as $val) {
            $aNewList[$val->oxgroups__oxid->value] = new stdClass();
            $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxid = new \OxidEsales\Eshop\Core\Field($val->oxgroups__oxid->value);
            $aNewList[$val->oxgroups__oxid->value]->oxgroups__oxtitle = new \OxidEsales\Eshop\Core\Field($val->oxgroups__oxtitle->value);
        }

        $this->_aViewData["allgroups2"] = $aNewList;

        if (isset($soxId) && $soxId != "-1") {
            $oDiscount = oxNew(\OxidEsales\Eshop\Application\Model\Discount::class);
            $oDiscount->load($soxId);

            if ($oDiscount->isDerived()) {
                $this->_aViewData["readonly"] = true;
            }
        }

        $iAoc = \OxidEsales\Eshop\Core\Registry::getConfig()->getRequestParameter("aoc");
        if ($iAoc == 1) {
            $oDiscountGroupsAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\DiscountGroupsAjax::class);
            $this->_aViewData['oxajax'] = $oDiscountGroupsAjax->getColumns();

            return "popups/discount_groups.tpl";
        } elseif ($iAoc == 2) {
            $oDiscountUsersAjax = oxNew(\OxidEsales\Eshop\Application\Controller\Admin\DiscountUsersAjax::class);
            $this->_aViewData['oxajax'] = $oDiscountUsersAjax->getColumns();

            return "popups/discount_users.tpl";
        }

        return "discount_users.tpl";
    }
136137
public function render()
    {
        $this->output->writeln(array(
            '',
            sprintf('<title>%s</>', $this->message),
            sprintf('<title>%s</>', str_repeat('=', Helper::strlenWithoutDecoration($this->output->getFormatter(), $this->message))),
            '',
        ));
    }
857365
private function printTags(OutputPrinter $printer, array $tags)
    {
        if (!count($tags)) {
            return;
        }

        $tags = array_map(array($this, 'prependTagWithTagSign'), $tags);
        $printer->writeln(sprintf('%s{+tag}%s{-tag}', $this->indentText, implode(' ', $tags)));
    }
1347667
function renderHyphenationField( $args ) {
		unset( $args['label_for'], $args['class'] );
		$this->renderCheckbox(
			[
				'id' => 'pdf_hyphens',
				'name' => 'pressbooks_theme_options_' . $this->getSlug(),
				'option' => 'pdf_hyphens',
				'value' => getset( $this->options, 'pdf_hyphens' ),
				'label' => $args[0],
			]
		);
	}
1156216
private function printExamplesTableHeader(OutputPrinter $printer, ExampleTableNode $table)
    {
        $printer->writeln(sprintf('%s{+keyword}%s:{-keyword}', $this->indentText, $table->getKeyword()));

        $rowNum = 0;
        $wrapper = $this->getWrapperClosure();
        $row = $table->getRowAsStringWithWrappedValues($rowNum, $wrapper);

        $printer->writeln(sprintf('%s%s', $this->subIndentText, $row));
    }
965109
function renderiBooksField() {
		$this->renderField(
			[
				'id' => 'ibooks',
				'name' => $this->getSlug(),
				'option' => 'ibooks',
				'value' => ( isset( $this->options['ibooks'] ) ) ? $this->options['ibooks'] : '',
				'type' => 'url',
				'class' => 'regular-text code',
			]
		);
	}
375055
public function renderHTML($print = false, $instrucoes = true)
    {
        $html = new Html();
        $html->addBoleto($this);
        !$print || $html->showPrint();
        $instrucoes || $html->hideInstrucoes();

        return $html->gerarBoleto();
    }
285928
function renderPageWidthField( $args ) {
		unset( $args['label_for'], $args['class'] );
		$this->renderField(
			[
				'id' => 'pdf_page_width',
				'name' => 'pressbooks_theme_options_' . $this->getSlug(),
				'option' => 'pdf_page_width',
				'value' => getset( $this->options, 'pdf_page_width' ),
				'description' => $args[0],
				'type' => 'text',
				'class' => 'small-text',
			]
		);
	}
695999
public function render()
    {
        $metric = new Metric('print-out');
        $metric->start();
        ini_set('memory_limit', '512M');

        if ( ! is_string($this->expression)) {
            $this->expression = print_r($this->expression, true);
        }

        $expression = htmlentities($this->expression);
        $expression = htmlspecialchars(htmlspecialchars_decode($this->expression, ENT_QUOTES), ENT_QUOTES, 'UTF-8');
        $trace = new Trace();

        $metric->stop();

        ob_start();
        include __DIR__ . '/Views/Screen.php';
        $output = ob_get_contents();
        ob_end_clean();

        return $output;
    }
607340
protected function _printLogo(&$output)
        {

            $output->writeLn('');
            $output->writeLn('');
            $output->writeLn('');
            $output->writeLn('<sw>          _           _                       _           </sw>');
            $output->writeLn('<sw>         | |         | |                     | |          </sw>');
            $output->writeLn('<sw>      ___| | __ _ ___| |____      _____  _ __| | _____    </sw>');
            $output->writeLn('<sw>     / __| |/ _` / __| \'_ \ \ /\ / / _ \| \'__| |/ / __|   </sw>');
            $output->writeLn('<sw>     \__ \ | (_| \__ \ | | \ V  V / (_) | |  |   <\__ \   </sw>');
            $output->writeLn('<sw>     |___/_|\__,_|___/_| |_|\_/\_/ \___/|_|  |_|\_\___/   </sw>');
            $output->writeLn('<fg=white>                                        web development   </fg=white>');
            $output->writeLn('');
            $output->writeLn('');
            $output->writeLn('                    [ <info>Cronjob Manager</info> ]');
            $output->writeLn('');
            $output->writeLn('');


        }
1319194
public function render($error)
	{
		try
		{
			if (!$this->document)
			{
				// We're probably in an CLI environment
				exit($error->getMessage());
			}

			$this->document->setType('error');

			// Push the error object into the document
			$this->document->setError($error);

			if (ob_get_contents())
			{
				ob_end_clean();
			}

			$this->document->setTitle(\Lang::txt('Error') . ': ' . $error->getCode());

			$template = $this->template->load();

			$data = $this->document->render(
				false,
				array(
					'template'  => $template->template,
					'directory' => dirname($template->path),
					'debug'     => $this->debug
				)
			);

			// Failsafe to get the error displayed.
			if (empty($data))
			{
				exit($error->getMessage() . ' in ' . $error->getFile() . ':' . $error->getLine());
			}
			else
			{
				$status = $error->getCode() ? $error->getCode() : 500;
				$status = ($status < 100 || $status >= 600) ? 500 : $status;

				$response = new Response($data, $status);
				$response->send();

				exit();
			}
		}
		catch (Exception $e)
		{
			$plain = new Plain($this->debug);
			$plain->render($e);
		}
	}
491660
protected function postrender($output)
    {
        // insert objects' contents
        foreach ($this->objects as $key => $val) {
            $output = str_replace($key, $val, $output, $count);
            if ($count) {
                $this->objects[$key] = null;
            }
        }

        // make sure all <form> tags have a valid request token
        $output = preg_replace_callback('/<form\s+([^>]+)>/Ui', array($this, 'alter_form_tag'), $output);

        return $output;
    }
485664
public function prettyPrint()
    {
        print($this->ecode . " (" . $this->getHttpStatus() . "): " .
            $this->getMessage() . "\n");
        if (!empty($this->errors)) {
            print("Field errors:\n");
            foreach($this->errors as $field_error) {
                foreach($field_error as $k => $v) {
                    print("  " . $k . ": " . $v . "\n");
                }
                print("\n");
            }
        }
    }
1048332
public function render()
    {
        parent::render();

        $soxId = $this->getEditObjectId();
        if (isset($soxId) && $soxId != "-1") {
            // load object
            $oUser = oxNew(\OxidEsales\Eshop\Application\Model\User::class);
            $oUser->load($soxId);
            $this->_aViewData["edit"] = $oUser;
        }

        return "user_overview.tpl";
    }
35909
public function _render_field()
    {
        $ret = [];

        if (!$this->args['field']) {
            throw new Exception([
                'No fields defined for table',
            ]);
        }

        foreach ($this->args['field'] as $field => $options) {
            if ($options instanceof Expression) {
                $ret[] = $this->_escape($field).' '.$this->_consume($options);
                continue;
            }

            $ret[] = $this->_render_one_field($field, $options);
        }

        return implode(',', $ret);
    }