Render the generic form
@param assign_form $form The form to render
@return string
194833
public function render_assign_form(assign_form $form) {
        $o = '';
        if ($form->jsinitfunction) {
            $this->page->requires->js_init_call($form->jsinitfunction, array());
        }
        $o .= $this->output->box_start('boxaligncenter ' . $form->classname);
        $o .= $this->moodleform($form->form);
        $o .= $this->output->box_end();
        return $o;
    }
135762
public function render(Nette\Forms\Form $form, $mode = null)
    {
        $form->getElementPrototype()->setClass('form-inline');

        foreach ($form->getControls() as $control) {
            if ($control instanceof Controls\Button) {
                $usedPrimary = true;
            } elseif ($control instanceof Controls\TextBase ||
                $control instanceof Controls\SelectBox ||
                $control instanceof Controls\MultiSelectBox) {
                $control->getControlPrototype()->addClass('form-control');
            } elseif ($control instanceof Controls\Checkbox ||
                $control instanceof Controls\CheckboxList ||
                $control instanceof Controls\RadioList) {
                $control->getSeparatorPrototype()->setName('div')->addClass($control->getControlPrototype()->type);
            }
        }

        return parent::render($form, $mode);
    }
554561
public function visitForm(FormInterface $form)
    {
        $template = "form/{$form->getType()}.twig";

        return $this
            ->loadTemplate($template)
            ->render(
                [
                    "id" => $form->getId(),
                    "classes" => $form->getClasses(),
                    "data" => $form->getData(),
                    "method" => $form->getMethod(),
                    "target" => $form->getTarget(),
                    "writables" => $form->getWritableBearer()->getWritables(),
                    "actions" => $form->getActions(),
                    "errors" => $form->getErrors(),
                ]
            );
    }
1137404
public function setForm($Form)
    {
        if (! is_object($Form) || ! $Form instanceof Helpers\Form) {
            throw new \InvalidArgumentException(
                'The Form Object must be a valid Helpers\Form Object'
            );
        }
        $this->Form = $Form;

        return true;
    }
611760
private function getAdultForm(array $form, FormStateInterface $form_state) {
    // Get steps for the form.
    $step = $form_state->getValue('step');
    if ($trigger = $form_state->getTriggeringElement()) {
      switch ($trigger['#name']) {
        case 'location':
          $step = 3;
          $this->clearForm(['program', 'category', 'rate', 'session'], $form_state);
          break;

        case 'category':
          $this->clearForm(['program', 'rate', 'session'], $form_state);
          $step = 4;
          break;

        case 'program':
          $this->clearForm(['rate', 'session'], $form_state);
          $step = 5;
          break;

        case 'session':
          $step = 6;
          break;
      }
      $form_state->setValue('step', $step);
    }

    // Locations.
    if ($form_state->getValue('step') >= 2) {
      $locations = $this->storage->getLocations();
      $options = array_filter($locations, [$this, 'filterLocations'], ARRAY_FILTER_USE_BOTH);
      if (empty($options)) {
        // Use all locations if user hasn't provided any filters.
        $options = $locations;
      }

      if (empty($options)) {
        return $this->noResults($form);
      }

      $form['location'] = [
        '#type' => 'radios',
        '#title' => $this->t('Location'),
        '#options' => $options,
        '#ajax' => $this->getAjaxDefaults(),
      ];
    }

    // Categories.
    if ($form_state->getValue('step') >= 3) {
      $categories = $this->storage->getCategoriesByBranch($form_state->getValue('location'));
      $items = array_filter($categories, [$this, 'filterCategories'], ARRAY_FILTER_USE_BOTH);
      if (empty($items)) {
        $items = $categories;
      }

      if (empty($categories)) {
        return $this->noResults($form);
      }

      $categories = [];
      foreach ($items as $item_id => $item_title) {
        $categories[$item_id] = $item_title;
      }

      $form['category'] = [
        '#type' => 'radios',
        '#title' => $this->t('Category'),
        '#options' => $categories,
        '#ajax' => $this->getAjaxDefaults(),
      ];
    }

    // Programs.
    if ($form_state->getValue('step') >= 4) {
      $items = $this->storage->getProgramsByBranchAndCategory($form_state->getValue('location'), $form_state->getValue('category'));
      if (empty($items)) {
        return $this->noResults($form);
      }

      $programs = [];
      foreach ($items as $item) {
        $programs[$item->id] = $item->name;
      }

      $form['program'] = [
        '#type' => 'radios',
        '#title' => $this->t('Program'),
        '#options' => $programs,
        '#ajax' => $this->getAjaxDefaults(),
      ];
    }

    if ($form_state->getValue('step') >= 5) {
      $items = $this->storage->getSessionsByProgramAndLocation($form_state->getValue('program'), $form_state->getValue('location'));
      if (empty($items)) {
        return $this->noResults($form);
      }

      $sessions = [];
      foreach ($items as $item) {
        $sessions[$item->id] = $item->name;
      }

      $form['session'] = [
        '#type' => 'radios',
        '#title' => $this->t('Session'),
        '#options' => $sessions,
        '#ajax' => $this->getAjaxDefaults(),
      ];
    }

    if ($form_state->getValue('step') >= 6) {
      $uri = $this->storage->getRegistrationLink($form_state->getValue('program'), $form_state->getValue('session'));
      $url = Url::fromUri($uri);
      $link = Link::fromTextAndUrl($this->t('link'), $url);

      $form['link'] = [
        '#type' => 'html_tag',
        '#tag' => 'div',
        '#attributes' => [
          'class' => 'result',
        ],
        '#value' => $this->t('Congrats! Here is your program registration %link!', ['%link' => $link->toString()]),
      ];
    }

    return $form;
  }
479360
function render() {
		if ($this->show_metainfo) {
			$this->appendtagbody($this->hidden('form')
				->value_is($this->signature()));
		}

		return parent::render();
	}
1326002
public function define_form(&$form) {
        $form->addElement('header', '_commonsettings', get_string('profilecommonsettings', 'admin'));
        $this->define_form_common($form);

        $form->addElement('header', '_specificsettings', get_string('profilespecificsettings', 'admin'));
        $this->define_form_specific($form);
    }
1209273
public function renderProfileForm(FormInterface $form = null, $widget = true)
    {
        if (empty($form)) {
            $form = $this->userFormFactory->createProfileForm();
        }

        $template = $widget
            ? 'DarvinUserBundle:User/widget:profile.html.twig'
            : 'DarvinUserBundle:User:profile.html.twig';

        return $this->templating->render($template, [
            'form' => $form->createView(),
        ]);
    }
1119096
public function render()
    {
        $tabs_html = '';
        $tabs_header = '';
        $tabs_control = '';

        // Iterate loaded form tabs
        foreach ($this->tabs as $tab) {
            // Gather tabs data to differrent collections
            $tabs_html .= $tab->content();
            $tabs_header .= $tab->header();
            $tabs_control .= $tab->control();
        }

        // Render view
        return m()
            ->title('Форма')
            ->view('form/index')
            ->cmsmaterial($this->material)
            ->tabs($tabs_html)
            ->tabs_control($tabs_control)
            ->tabs_headers($tabs_header)
            ->output();
    }
644320
public function display(Form $form) {
        if (!$this->visible){
            return "";
        }
        $this->form = $form;
        if (!isset($this->rowHtmlOptions['class'])) {
            $this->rowHtmlOptions['class'] = $this->rowClass;
        } else {
            $this->rowHtmlOptions['class'] .= ' ' . $this->rowClass;
        }
        if (!is_null($this->getError())){
            $this->rowHtmlOptions['class'] .= ' has-error';
        }
        return Html::get()->tag('div', $this->getContent(), $this->rowHtmlOptions);
    }
830681
public function renderForm(FormInterface $form, TemplateManagerInterface $templateManager, string $templateName = 'template')
    {
         $this->setTemplateManager($templateManager)
            ->validateTemplate($this->getTemplate($templateName));

         $this->form = $form;

         $props = [];
         $props['locale'] = $this->getLocale();
         $props['template'] = $this->getTemplate($templateName);
         $props['form'] =  $this->extractForm($form->createView());
         $props['errors'] = $this->getFormErrors($form);
         $props['target_div'] = $this->getTargetDivision();
         $props['translations'] = [
             'object' => 'Must be an Object, not an Array',
             'All errors must be cleared before the form can be saved!' => $this->getTranslator()->trans('All errors must be cleared before the form can be saved!', [], 'messages'),
             'The value should not be empty!' => $this->getTranslator()->trans('The value should not be empty!', [], 'messages'),
             'Enter Text' => $this->getTranslator()->trans('Enter Text', [], 'messages'),
         ];
         $this->props = $props;

         return new \Twig_Markup($this->getTwig()->render('@HillrangeForm/renderForm.html.twig',
             [
                 'props' => $props,
             ]
         ), 'html');
    }
123161
private function renderMain($form)
	{
		// #main .content
		echo CHtml::openTag('div', array('id' => 'main', 'class' => 'nano'));
			echo CHtml::openTag('div', array('class' => 'nano-content'));

				echo CHtml::openTag('fieldset');

					// If we want a custom form view, render that view instead of the default behavior
					if ($this->model->form !== NULL)
						$this->controller->renderPartial($this->model->form, array('model' => $this->model, 'properties' => $this->properties, 'form' => $form));
					else if (count($this->properties) == 0)
					{
						echo CHtml::tag('legend', array(), Yii::t('Dashboard.main', 'Change Theme Settings'));
						echo CHtml::tag('div', array('class' => 'alert alert-info'), Yii::t('Dashboard.main', 'There are no settings for this section.'));
					}
					else
					{
						$groups = $this->model->groups();

						if (!empty($groups))
						{
							foreach ($groups as $name=>$attributes)
							{
								echo CHtml::tag('legend', array(), $name);
								echo CHtml::tag('div', array('class' => 'clearfix'), NULL);
								foreach ($attributes as $property)
								{
									$p = new StdClass();
									$p->name = $property;
									$this->renderProperties($form, $p);
								}
							}
						}
						else
						{
							echo CHtml::tag('legend', array(), CiiInflector::titleize(get_class($this->model)));
							foreach ($this->properties as $property)
							{
								$this->renderProperties($form, $property);
							}
						}
					}

				echo CHtml::closeTag('div');
			echo CHtml::closeTag('div');
		echo CHtml::closeTag('div');
	}
473426
function (form) {
              helpers.render(req, res, view, { form: form, organization: req.organization });
            }
652863
public function createResult(Form $form)
    {
        $result = new Result();
        $result->setDatetimeAdded(new \DateTime());

        $viewData = $form->getSf2Form()->getViewData();

        foreach ($form->getFields() as $field) {
            $entry = new Entry();
            $entry->setField($field);
            $entry->setValue($viewData['field_'.$field->getId()]);
            $result->addEntry($entry);
        }

        return $result;
    }
98455
protected function setForm(Doozr_Form_Service_Component_Interface_Form $form = null)
    {
        // Check for scope inject requirement
        if (null !== $form && null === $form->getName()) {
            $form->setName($this->getScope());
        }

        $this->form = $form;
    }
378756
public function setForm($form)
    {
        // Associate Form Instance (via parent):
        
        parent::setForm($form);
        
        // Associate Rules with Fields:
        
        foreach ($this->rules as $fieldName => $rules) {
            
            if ($field = $this->getDataField($fieldName)) {
                
                foreach ($rules as $rule) {
                    $rule->setField($field);
                }
                
            }
            
        }
        
        // Associate Backend with Self:
        
        $this->backend->setFrontend($this);
        
        // Initialise Backend:
        
        $this->backend->doInit();
        
        // Define Form Classes:
        
        if ($classes = $this->getClassesForForm($form)) {
            
            foreach ($classes as $class) {
                $form->addExtraClass($class);
            }
            
        }
        
        // Define Form Attributes:
        
        if ($attributes = $this->getAttributesForForm($form)) {
            
            foreach ($attributes as $key => $value) {
                $form->setAttribute($key, $value);
            }
            
        }
        
        // Answer Self:
        
        return $this;
    }
87766
public static function populateForm(Form $form)
	{
		if (static::$builder === null)
		{
			static::setBuilder(new V1Model);

			static::$builder->setWrapperElement(null);
		}

		$elements = static::$builder->generate(get_called_class());

		return $form->setContents($elements);
	}