Ustaw kolejność realizacji
@param array $renderingOrder
@return ElementAbstract
@throws \Mmi\Form\FormException
967478
public final function setRenderingOrder(array $renderingOrder = [])
    {
        foreach ($renderingOrder as $method) {
            if (!method_exists($this, $method)) {
                throw new \Mmi\Form\FormException('Unknown rendering method');
            }
        }
        $this->_renderingOrder = $renderingOrder;
        return $this;
    }
399536
public function render(RendererInterface $renderer = null)
    {
        $renderer = $renderer ?: $this->getDefaultRenderer();
        $form = $this->header();
        foreach ($this->rows as $row) {
            $form .= $row->render($renderer);
        }
        $form .= '</form>';

        return $form;
    }
1278722
public function addElement(\FrenchFrogs\Form\Element\Element $element, FrenchFrogs\Renderer\Renderer $renderer = null)
    {
        // Join element to the form
        $element->setForm($this);

        $this->elements[$element->getName()] = $element;

        return $this;
    }
1181954
public function display(core_backup_renderer $renderer) {
        $form = $this->initialise_stage_form();
        $form->require_definition_after_data();
        if ($e = $form->get_element('submitbutton')) {
            $e->setLabel(get_string('import'.$this->get_ui()->get_name().'stage'.$this->get_stage().'action', 'backup'));
        } else {
            $elements = $form->get_element('buttonar')->getElements();
            foreach ($elements as &$element) {
                if ($element->getName() == 'submitbutton') {
                    $element->setValue(
                        get_string('import'.$this->get_ui()->get_name().'stage'.$this->get_stage().'action', 'backup')
                    );
                }
            }
        }

        // A nasty hack follows to work around the sad fact that moodle quickforms
        // do not allow to actually return the HTML content, just to echo it.
        flush();
        ob_start();
        $form->display();
        $output = ob_get_contents();
        ob_end_clean();

        return $output;
    }
1248196
public function render(Element $element)
    {
        // our HTML container
        $html = '';

        // If this is a field, also render our title
        if ($element instanceof AbstractFormField) {
            $html .= '<label>';
            $html .= $element->getTitle();

            // If the field is required, render a red asterisk
            if ($element->isRequired()) {
                $html .= ' <span style="color:red">*</span>';
            }

            $html .= ':</label> ';
        }

        // Now add the default rendering logic to it.
        // This will take care of rendering the rest
        $html .= parent::render($element);

        return $html;
    }
309026
private function renderElements(
        FieldsetInterface $elements, $formClass, $output, $submitElements, $offset = 2
    ) {
        foreach ($elements as $element) {
            if ($element instanceof FieldsetInterface) {
                list($output, $submitElements) = $this->renderElements(
                    $element, $formClass, $output, $submitElements
                );
            } elseif ($element instanceof Submit
                || $element instanceof Button
            ) {
                $submitElements[] = $element;
            } elseif (
                $element instanceof Csrf || $element instanceof Hidden
            ) {
                $output .= $this->getView()->formElement($element);
            } elseif ($element instanceof Checkbox) {
                $viewModel = new ViewModel();
                $viewModel->setVariable('element', $element);
                $viewModel->setVariable('offset', $offset);
                $viewModel->setTemplate(
                    'travello-view-helper/widget/bootstrap-form-checkbox'
                );

                $output .= $this->getView()->render($viewModel);
            } else {
                if ($element instanceof File) {
                    $element->setAttributes(
                        ['class' => 'form-control-static']
                    );
                } else {
                    $element->setAttributes(['class' => 'form-control']);
                }

                if ($formClass == 'form-inline') {
                    $element->setLabelAttributes(
                        ['class' => 'control-label']
                    );

                    $template = 'bootstrap-form-group-inline';
                } else {
                    $element->setLabelAttributes(
                        ['class' => 'col-sm-' . $offset . ' control-label']
                    );

                    $template = 'bootstrap-form-group';
                }

                $viewModel = new ViewModel();
                $viewModel->setVariable('element', $element);
                $viewModel->setVariable('offset', $offset);
                $viewModel->setTemplate(
                    'travello-view-helper/widget/' . $template
                );

                $output .= $this->getView()->render($viewModel);
            }
        }

        return [$output, $submitElements];
    }
601649
public function getCreateForm ($requestOrDataArray, array $options=array(), $entity=false)
    {
        $formBuilder = $this->Core->getFormFactory();
        if (false === $entity) {
            $newEntity = new $this->entityClass();
        } else {
            $newEntity = $entity;
        }
        $createForm  = $formBuilder->create(new $this->createFormClass(), $newEntity, $options);

        // Bind request data to form
        if (is_array($requestOrDataArray)) {
            $createForm->submit($requestOrDataArray);
        } else {
            $createForm->handleRequest($requestOrDataArray);
        }

        return $createForm;
    }
720724
public function jsonRenderer($elements): Renderer
    {
        if (!is_array($elements) && !is_object($elements)) {
            throw new Server500(new \ArrayObject(array("explain" =>
                "The parameters {elements} is not a valid object/array for json renderer ",
                "solution" => "Please set a valid parameters for json renderer {object|array}")));
        }

        $this->display_elements = array("json" => (array)$elements, JSON_PRETTY_PRINT);
        return ($this);
    }
842226
public function extend(string $extension, $renderer): ViewFactory
	{
		$this->renderers = [$extension => $renderer] + $this->renderers;

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

        return $renderer->render($this->getRelations(), $active);
    }
927469
function elementCreate(name, overriddenRenderer) {
    var native;
    var rendererToUse = overriddenRenderer || renderer;
    if (isProceduralRenderer(rendererToUse)) {
        native = rendererToUse.createElement(name, _currentNamespace);
    }
    else {
        if (_currentNamespace === null) {
            native = rendererToUse.createElement(name);
        }
        else {
            native = rendererToUse.createElementNS(_currentNamespace, name);
        }
    }
    return native;
}
1229229
public function render(Render $renderer)
	{
		$elements = '';

		foreach ( $this->getContents() as $element )
		{
			$elements .= "\n" . $renderer->render($element);
		}

		return Html::tag('form', $this->getAttributes(), $elements);
	}
969534
public function render(HTML_QuickForm2_Renderer $renderer)
    {
        $renderer->startGroup($this);
        foreach ($this as $element) {
            $element->render($renderer);
        }
        $renderer->finishGroup($this);
        return $renderer;
    }
419797
function renderElement(&$element, $required, $error){
        global $OUTPUT;

        // Make sure the element has an id.
        $element->_generateId();
        $advanced = isset($this->_advancedElements[$element->getName()]);

        $html = $OUTPUT->mform_element($element, $required, $advanced, $error, false);
        $fromtemplate = !empty($html);
        if (!$fromtemplate) {
            // Adding stuff to place holders in template
            // check if this is a group element first.
            if (($this->_inGroup) and !empty($this->_groupElementTemplate)) {
                // So it gets substitutions for *each* element.
                $html = $this->_groupElementTemplate;
            } else if (method_exists($element, 'getElementTemplateType')) {
                $html = $this->_elementTemplates[$element->getElementTemplateType()];
            } else {
                $html = $this->_elementTemplates['default'];
            }
            if (isset($this->_advancedElements[$element->getName()])) {
                $html = str_replace(' {advanced}', ' advanced', $html);
                $html = str_replace(' {aria-live}', ' aria-live="polite"', $html);
            } else {
                $html = str_replace(' {advanced}', '', $html);
                $html = str_replace(' {aria-live}', '', $html);
            }
            if (isset($this->_advancedElements[$element->getName()]) || $element->getName() == 'mform_showadvanced') {
                $html = str_replace('{advancedimg}', $this->_advancedHTML, $html);
            } else {
                $html = str_replace('{advancedimg}', '', $html);
            }
            $html = str_replace('{id}', 'fitem_' . $element->getAttribute('id'), $html);
            $html = str_replace('{typeclass}', 'f' . $element->getType(), $html);
            $html = str_replace('{type}', $element->getType(), $html);
            $html = str_replace('{name}', $element->getName(), $html);
            $html = str_replace('{groupname}', '', $html);
            $html = str_replace('{class}', $element->getAttribute('class'), $html);
            $emptylabel = '';
            if ($element->getLabel() == '') {
                $emptylabel = 'femptylabel';
            }
            $html = str_replace('{emptylabel}', $emptylabel, $html);
            if (method_exists($element, 'getHelpButton')) {
                $html = str_replace('{help}', $element->getHelpButton(), $html);
            } else {
                $html = str_replace('{help}', '', $html);
            }
        } else {
            if ($this->_inGroup) {
                $this->_groupElementTemplate = $html;
            }
        }
        if (($this->_inGroup) and !empty($this->_groupElementTemplate)) {
            $this->_groupElementTemplate = $html;
        } else if (!isset($this->_templates[$element->getName()])) {
            $this->_templates[$element->getName()] = $html;
        }

        if (!$fromtemplate) {
            parent::renderElement($element, $required, $error);
        } else {
            if (in_array($element->getName(), $this->_stopFieldsetElements) && $this->_fieldsetsOpen > 0) {
                $this->_html .= $this->_closeFieldsetTemplate;
                $this->_fieldsetsOpen--;
            }
            $this->_html .= $html;
        }
    }
78660
public function render()
    {
        $this->getEventManager()->trigger(
            'formBeforeRender',
            $this,
            array(

            )
        );
        $output = parent::render();
        $this->getEventManager()->trigger(
            'formAfterRender',
            $this,
            array(
                'output' => &$output
            )
        );
        return $output;
    }
53691
public function render()
	{
		/** @var BootstrapRenderer $renderer */
		$renderer = $this->container->form->renderer;

		$element = $renderer->configElem(RendererConfig::gridRow, $this->elementPrototype);
		foreach ($this->cells as $cell) {
			$cellHtml = $cell->render();
			$element->addHtml($cellHtml);
		}

		return $element;
	}
102179
public function render()
    {
        // Set the request arguments as GET parameters
        $_GET = $this->getRequestArguments();

        try {
            $rendererClassName = $this->element->getRendererClassName();

            /** @var FluidFormRenderer $renderer */
            $renderer = $this->objectManager->get($rendererClassName);
            if (!($renderer instanceof RendererInterface)) {
                throw new RenderingException(
                    sprintf('The renderer "%s" des not implement RendererInterface', $rendererClassName),
                    1326096024
                );
            }
            $renderer->setControllerContext($this->controllerContext);

            $this->controllerContext->getRequest()->setOriginalRequestMappingResults($this->validationErrors);
            $response = $this->objectManager->get(Response::class, $this->controllerContext->getResponse());
            /** @var FormRuntime $form */
            $form = $this->form->bind($this->controllerContext->getRequest(), $response);
            $renderer->setFormRuntime($form);

            $result = $this->beautify($renderer->render());

            // In case of an error
        } catch (\Exception $e) {
            $result = '<pre class="error"><strong>'.$e->getMessage().'</strong>'.PHP_EOL
                      .$e->getTraceAsString().'</pre>';
        }

        return $result;
    }