Render form
@param boolean $return Do you want to return the HTML?
176390
public function render($return = false) {
        $html = "<form";
        if($this->id) $html .= " id='$this->id'";
        if($this->class) $html .= " class='$this->class'";
        if($this->action || $this->action == "") $html .= " action='$this->action'";
        if($this->method) $html .= " method='$this->method'";
        if($this->enctype) $html .= " enctype='$this->enctype'";
        if($this->custom) $html .= " $this->custom";
        $html .= ">";
        
        // Render all the controls
        foreach($this->controls as $control) {
            if($control->isPlainControl()){
                $html .= $control->renderBasic();
            }else{
                $html .= $this->renderControl($control, true);                
            }
        }
        
        // Close the form
        $html .= "</form>";
        
        // Return or echo
        if($return) return $html;
        echo $html;
    }
223335
public function cacheThemeConfig($return=false)
	{
		$themes = $this->getThemesFromDb();
		$arrayTheme = array();

		foreach($themes as $theme) {
			if(!in_array($theme->folder, $arrayTheme))
				$arrayTheme[] = $theme->folder;
		}

		if($return == false) {
			$filePath   = Yii::getPathOfAlias('application.config');
			$fileHandle = fopen($filePath.'/cache_theme.php', 'w');
			fwrite($fileHandle, implode("\n", $arrayTheme));
			fclose($fileHandle);

		} else 
			return $arrayTheme;
	}
1259645
public function render($force = false) {

		if(empty($this->html) || $force) {

			$this->attributes['type'] = 'password';
			$this->html = parent::render(true);

		}

		return $this->html;

	}
950792
public function renderMetaBox($post, $post_config, $return = false)
    {
        $config = $this->getMetaBoxConfig($post_config['args']);
        if (!Arr::iterable($config['fields'])) {
            return false;
        }

        $this->load($post);

        $out = array();
        $out[] = '<table>';
        foreach ($config['fields'] as $name => $field) {
            // Hack to know if we're editing an existing post
            $is_existing_post = (
                is_array($_SERVER)
                && array_key_exists('REQUEST_URI', $_SERVER)
                && preg_match('/post=([\d]{1,})/', $_SERVER['REQUEST_URI'])
            );
            
            $field['type'] = (array_key_exists('type', $field)) ? $field['type'] : 'text';

            if (array_key_exists($name, $this->_info)) {
                $field['value'] = $this->_info[$name];
            } elseif ($is_existing_post && $field['type'] !== 'html') {
                $field['value'] = null;
            }

            $default = null;
            if (array_key_exists('default', $field)) {
                if ($field['type'] === 'select') {
                    $default = $field['options'][$field['default']];
                } elseif ($field['type'] === 'image') {
                    $default = '<br>'.Html::image($field['default'], null, array('style'=>'max-width:100px;'));
                } else {
                    $default = nl2br($field['default']);
                }
            }
            $tr_class = $name;
            if ($field['type'] === 'hidden') {
                $tr_class .= ' hidden';
            }
            $out[] = sprintf(
                '<tr%s><td>%s</td><td>%s%s%s</td></tr>',
                Html::attribs(array('class'=>$tr_class)),
                $this->getRenderLabel($name),
                $this->getRenderMetaBoxField($name, $field),
                (array_key_exists('description', $field)) ? Html::p($field['description'], array('class'=>'description')) : null,
                (!is_null($default)) ? sprintf('<p class="description">Default: %s</p>', $default) : null
            );
        }
        $out[] = '</table>';

        $html = join("\n", $out);
        if ($return) {
            return $html;
        }
        echo $html;
    }
482745
public function render($force = false) {

        if(empty($this->html) || $force) {

            $attr = [
                sprintf('src="%s"', $this->getValue()),
                'type="image"'
            ];

            foreach($this->attributes as $k => $v) {

                if(in_array(strtolower($k), ['src', 'value', 'type'])) {
                    continue;
                }
                $attr[] = sprintf('%s="%s"', $k, $v);

            }

            $this->html = sprintf('<input name="%s" %s>',
                $this->getName(),
                implode(' ', $attr)
            );

        }

        return $this->html;

	}
1064840
public function output($action = '', $return = false)
    {
        $hash = $this->generate($action);
        $token = '<input type="hidden" name="' . static::DEFAULT_TOKEN_NAME . '" value="' . $hash . '" />';
        if (!$return) {
            echo $token;
        } else {
            return $token;
        }
    }
565112
public function run($return = false)
    {
        $output = "";

        foreach ($this->stack as $view) { /** @var View $view */
            $data = $view->getData();

            if (! is_array($data)) {
                $data = array();
            }

            if ($view->getType() === View::PART_BODY_PLACEHOLDER) {
                throw new RendererException("The body placeholder isn't replaced!"); // @codeCoverageIgnore
            }

            if (! empty($this->globalData)) {
                $data = array_merge($data, $this->globalData);
            }

            $engineClass = $view->getEngine();
            /** @var RendererInterface $engine */
            $engine = $engineClass->newInstance();

            if (! $engine instanceof RendererInterface) { // @codeCoverageIgnore
                throw new RendererException("Engine is not instance of the RendererInterface."); // @codeCoverageIgnore
            } // @codeCoverageIgnore

            // Render it!
            $output .= $engine->render($view, $data);
        }

        // If we need to return. Then just return it.
        if ($return) {
            return $output;
        }

        // Instead, create response object and return it.
        return new Response($output, 200); // @codeCoverageIgnore
    }
287559
public function render($echo = false)
    {
        $name = $this->field->getName();
        $display = $this->field->getDisplayName();
        $value = $this->getValue();
        $readOnly = $this->getReadOnlyString();
        $required = $this->getRequiredString();

        $html  = <<< HTML

        <div class="form-group">
            <label  for="field-$name">$display</label>
            <div class="input-group">
              <div class="input-group-addon">
                <i class="fa fa-laptop"></i>
              </div>
              <input id="field-$name" type="text" class="form-control" data-inputmask="'alias': 'ip'" data-mask="" name="$name" value="$value" $readOnly $required >
            </div>
        </div>

HTML;

        if ($echo)
            echo $html;

        return $html;
    }
67784
public static function dump($var, bool $return = false)
    {
        if ($return) {
            \ob_start();
            Dumper::dump($var, [
                Dumper::DEPTH => self::$maxDepth,
                Dumper::TRUNCATE => self::$maxLength,
            ]);

            return \ob_get_clean();
        }

        if (!self::isProductionMode()) {
            Dumper::dump($var, [
                Dumper::DEPTH => self::$maxDepth,
                Dumper::TRUNCATE => self::$maxLength,
                Dumper::LOCATION => self::$showLocation,
            ]);
        }

        return $var;
    }
1080689
public function _render()
    {
        $ret = $this->prepend;
        if ($this->library) {
            $ret .= $this->library;
        } else {
            if ($this->str) {
                $ret .= "$('#".$this->owner->getJSID()."')";
            }
        }
        $ret .= $this->str;

        if ($this->enclose === true) {
            if ($this->preventDefault) {
                $ret = 'function(ev,ui){ev.preventDefault();ev.stopPropagation(); '.$ret.'}';
            } else {
                $ret = 'function(ev,ui){'.$ret.'}';
            }
        } elseif ($this->enclose) {
            $ret = ($this->library ?: "$('#".$this->owner->getJSID()."')").
                    ".bind('".$this->enclose."',function(ev,ui){ev.preventDefault();ev.stopPropagation(); ".$ret.'})';
        }

        if (@$this->debug) {
            echo "<font color='blue'>".htmlspecialchars($ret).';</font><br/>';
            $this->debug = false;
        }

        return $ret;
    }
151001
public function renderForm()
    {
        $html = $this->form_open();
        $html .= $this->renderSubForm();
        $html .= $this->form_close();

        return $html;
    }
171565
public function error($return = false)
    {
        if (!empty($this->error)) {
            if ($return) {
                return $this->error;
            }
            var_dump($this->error);
            return null;
        }
        return false;
    }
573419
public function executeRedirection($return = false)
    {
        $html = $this->createForm();
        $html .= '<script>document.forms["'.$this->_setNameForm.'"].submit();</script>';

        if (!$return) {
            echo $html;

            return null;
        }

        return $html;
    }
183880
public function default($return): ResponseInterface
    {
        if ($this->output === null) {
            $this->to();
        }

        switch ($this->output) {
            case 'json':
                if ($return === true) {
                    $return = [];
                }

                return $this->json($return);

            case 'text':
                return $this->text($return);

            case 'html':
                return $this->html($return);

            case 'template':
                return $this->template(null, $return);

            case 'redirect':
                return $this->redirect($return);

            case 'file':
                return $this->file($return);

            default:
                return $this->empty();
        }
    }
766412
protected function load($filename, $data = array(), $return = false)
    {
        $template = $this->createSubTemplate();

        try {
            return $template->renderTemplate($filename, $data, $return);
        } catch (\Exception $exception) {
            if (!empty($this->log))
            {
                $this->log->error("Failed to render template " . $filename, $exception);
            }
            return '';
        }
    }
113632
def render(self):
        """"""
        return Markup(env.get_template('form.html').render(form=self,
                                                           render_open_tag=True,
                                                           render_close_tag=True,
                                                           render_before=True,
                                                           render_sections=True,
                                                           render_after=True,
                                                           generate_csrf_token=None if self.disable_csrf else _csrf_generation_function))
441555
public function display ($output = TRUE)
	{
		
		// JSON encode
		
		$response	= json_encode ($this->response);
		
		// Output
		
		if ($output)
		{
			
			// Output headers

			header ('Cache-Control: no-cache, must-revalidate');
			header ('Content-type: application/json; charset=utf-8');
			
			// Output response
			
			echo $response;
			
		}
		
		// Return
		
		return $response;
		
	}