Render the component

Usually only used internally or for debugging

@param bool if view cache should be used, if null config setting will be used
@param bool if master should be rendered
@return string
194769
public function render($enableCache = null, $renderMaster = false, &$hasDynamicParts = false)
    {
        $output = new Kwf_Component_Renderer();
        if ($enableCache !== null) $output->setEnableCache($enableCache);
        if ($renderMaster) {
            return $output->renderMaster($this, $hasDynamicParts);
        } else {
            return $output->renderComponent($this, $hasDynamicParts);
        }
    }
1023413
public function convertToCamelCasedMethods($bool = null)
    {
        if ($bool === null) {
            return $this->camel_cased_methods;
        }

        return $this->camel_cased_methods = $bool;
    }
544510
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		GridLayout layout = (GridLayout) panel.getLayout();
		Size hgap = layout.getHorizontalGap();
		String hgapString = hgap == null ? null : hgap.toString();
		Size vgap = layout.getVerticalGap();
		String vgapString = vgap == null ? null : vgap.toString();
		int rows = layout.getRows();
		int cols = layout.getCols();

		xml.appendTagOpen("ui:gridlayout");

		xml.appendAttribute("rows", rows > 0 ? String.valueOf(rows) : "0");
		xml.appendAttribute("cols", cols > 0 ? String.valueOf(cols) : "0");
		xml.appendOptionalAttribute("hgap", hgapString);
		xml.appendOptionalAttribute("vgap", vgapString);

		xml.appendClose();

		int size = panel.getChildCount();

		for (int i = 0; i < size; i++) {
			xml.appendTag("ui:cell");
			WComponent child = panel.getChildAt(i);
			child.paint(renderContext);
			xml.appendEndTag("ui:cell");
		}

		xml.appendEndTag("ui:gridlayout");
	}
75658
public boolean render(RootDoc rootDoc, DocletRenderer renderer) {
        if (!processOverview(rootDoc, renderer)) {
            return false;
        }
        Set<PackageDoc> packages = new HashSet<PackageDoc>();
        for (ClassDoc doc : rootDoc.classes()) {
            packages.add(doc.containingPackage());
            renderClass(doc, renderer);
        }
        for (PackageDoc doc : packages) {
            renderer.renderDoc(doc);
        }
        return true;
    }
556030
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WAbbrText abbrText = (WAbbrText) component;
		XmlStringBuilder xml = renderContext.getWriter();

		xml.appendTagOpen("abbr");
		xml.appendOptionalAttribute("title", abbrText.getToolTip());
		xml.appendOptionalAttribute("class", abbrText.getHtmlClass());
		xml.appendClose();
		xml.append(abbrText.getText(), abbrText.isEncodeText());
		xml.appendEndTag("abbr");
	}
318947
public function usePHPSession($bool = true)
    {
        if (!isset($_SESSION)) {
            session_start();
        }
        $this->_phpsession = $bool;
        return $this;
    }
464436
public function caching($bool = null)
	{
		if (is_bool($bool))
		{
			$this->_config['enable_cache'] = $bool;
			return $this;
		}
		return \Arr::get($this->_config, 'enable_cache', true);
	}
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;
    }
1360535
public function isDeleted($bool = null)
    {
        if ($bool === null) {
            return $this->deleted;
        }

        $this->deleted = (bool) $bool;

        return $this;
    }
116736
function render() {
  return function(...args) {
    return (
      <PseudoContext.Consumer>
        {value => {
          if (!value) {
            return defaultTextRender.apply(this, args);
          }
          return renderText(args, this);
        }}
      </PseudoContext.Consumer>
    );
  };
}
1311945
public function render(array $values, bool $debug = false)
    {
        $vals = $this->compileValues($values);
        return str_replace(array_keys($vals), array_values($vals), $this->templateSource);
    }
1096422
@Override
	public void render(final WComponent component, final RenderContext context) {
		PrintWriter out = ((WebXmlRenderContext) context).getWriter();

		// If we are debugging the layout, write markers so that the html
		// designer can see where templates start and end.
		boolean debugLayout = ConfigurationProperties.getDeveloperVelocityDebug();

		if (debugLayout) {
			String templateUrl = url;

			if (url == null && component instanceof AbstractWComponent) {
				templateUrl = ((AbstractWComponent) component).getTemplate();
			}

			out.println("<!-- Start " + templateUrl + " -->");
			paintXml(component, out);
			out.println("<!-- End   " + templateUrl + " -->");
		} else {
			paintXml(component, out);
		}
	}
1245304
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WToggleButton toggle = (WToggleButton) component;
		XmlStringBuilder xml = renderContext.getWriter();
		boolean readOnly = toggle.isReadOnly();


		xml.appendTagOpen("ui:togglebutton");
		xml.appendAttribute("id", component.getId());
		xml.appendOptionalAttribute("class", component.getHtmlClass());
		xml.appendOptionalAttribute("track", component.isTracking(), "true");
		xml.appendOptionalAttribute("hidden", toggle.isHidden(), "true");
		xml.appendOptionalAttribute("selected", toggle.isSelected(), "true");
		if (readOnly) {
			xml.appendAttribute("readOnly", "true");
		} else {
			WComponentGroup<WCheckBox> group = toggle.getGroup();
			String groupName = group == null ? null : group.getId();
			xml.appendOptionalAttribute("groupName", groupName);
			xml.appendOptionalAttribute("disabled", toggle.isDisabled(), "true");
			xml.appendOptionalAttribute("submitOnChange", toggle.isSubmitOnChange(), "true");
			xml.appendOptionalAttribute("toolTip", toggle.getToolTip());
			xml.appendOptionalAttribute("accessibleText", toggle.getAccessibleText());
		}
		xml.appendClose();
		String text = toggle.getText();
		if (text != null) {
			xml.appendEscaped(text);
		}
		if (!readOnly) {
			DiagnosticRenderUtil.renderDiagnostics(toggle, renderContext);
		}
		xml.appendEndTag("ui:togglebutton");
	}
1367313
@Override
	public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
		WPanel panel = (WPanel) component;
		XmlStringBuilder xml = renderContext.getWriter();
		BorderLayout layout = (BorderLayout) panel.getLayout();
		Size hgap = layout.getHorizontalGap();
		String hgapString = hgap == null ? null : hgap.toString();
		Size vgap = layout.getVerticalGap();
		String vgapString = vgap == null ? null : vgap.toString();

		xml.appendTagOpen("ui:borderlayout");

		xml.appendOptionalAttribute("hgap", hgapString);
		xml.appendOptionalAttribute("vgap", vgapString);

		xml.appendClose();

		// Fetch the children and their constraints.
		final int childCount = panel.getChildCount();
		List<Duplet<WComponent, BorderLayoutConstraint>> children = new ArrayList<>(childCount);

		for (int i = 0; i < childCount; i++) {
			WComponent child = panel.getChildAt(i);
			children.add(new Duplet<>(child, getConstraints(panel, child)));
		}

		// Now paint them
		paintChildrenWithConstraint(children, renderContext, BorderLayout.NORTH);
		paintChildrenWithConstraint(children, renderContext, BorderLayout.EAST);
		paintChildrenWithConstraint(children, renderContext, BorderLayout.SOUTH);
		paintChildrenWithConstraint(children, renderContext, BorderLayout.WEST);
		paintChildrenWithConstraint(children, renderContext, BorderLayout.CENTER);

		xml.appendEndTag("ui:borderlayout");
	}
234681
public function isHtml($bool = true)
    {
        $key = 'content-type';

        return $bool
            ? $this->withHeader($key, 'text/html; charset="iso-8859-1"')
            : $this->withHeader($key, 'text/plain; charset="iso-8859-1"');
    }
811335
public function ignoreWhitespaces(bool $bool = true): Compare
    {
        $this->ignoreWhitespaces = $this->useOption('-w', $bool);
        return $this;
    }
361248
@Override
    public boolean render (
        InternalContextAdapter context, Writer writer, Node node)
        throws IOException, ResourceNotFoundException, ParseErrorException,
               MethodInvocationException
    {
        // make sure an argument was supplied to the directive
        if (node.jjtGetChild(0) == null) {
            rsvc.getLog().error("#import() error :  null argument");
            return false;
        }

        // make sure that argument has a value
        Object value = node.jjtGetChild(0).value(context);
        if (value == null) {
            rsvc.getLog().error("#import() error :  null argument");
            return false;
        }

        // obtain the path to the desired template
        String path = value.toString();

        // make sure we haven't exceeded the configured parse depth
        Object[] templateStack = context.getTemplateNameStack();
        int maxlen = rsvc.getInt(
            RuntimeConstants.PARSE_DIRECTIVE_MAXDEPTH, 20);
        if (templateStack.length >= maxlen) {
            rsvc.getLog().error("Max recursion depth reached (" + maxlen + "). "  +
                                "File stack: " + StringUtil.toString(templateStack) + ".");
            return false;
        }

        // inherit the current encoding if there is a current template,
        // otherwise use the configured encoding
        String encoding = null;
        Resource current = context.getCurrentResource();
        if (current != null) {
            encoding = current.getEncoding();
        } else {
            encoding = (String)
                rsvc.getProperty(RuntimeConstants.INPUT_ENCODING);
        }

        // adjust the template path with the site information in the current
        // context if available. the siteid is shoved into the context by the
        // dispatcher servlet when we're using the site resource loader. this
        // is a hack, i know, but i couldn't convince the velocity peeps that
        // we should have access to a request context in places like this
        Object siteIdVal = context.get("__siteid__");
        if (siteIdVal != null) {
            int siteId = SiteIdentifier.DEFAULT_SITE_ID;
            try {
                siteId = ((Integer)siteIdVal).intValue();
            } catch (Exception e) {
                rsvc.getLog().error("#import() error: No siteId information in context.");
            }
            path = siteId + ":" + path;
        }

        // locate the requested template
        Template t = null;
        try {
            t = rsvc.getTemplate(path, encoding);

        } catch (ResourceNotFoundException rnfe) {
            rsvc.getLog().error("#import(): cannot find template '" + path +
                                "', called from template " + context.getCurrentTemplateName() +
                                " at (" + getLine() + ", " + getColumn() + ")");
            throw rnfe;

        } catch (ParseErrorException pee) {
            rsvc.getLog().error("#import(): syntax error in #import()-ed template '" + path +
                                "', called from template " + context.getCurrentTemplateName() +
                                " at (" + getLine() + ", " + getColumn() + ")");
            throw pee;

        } catch (Exception e) {
            rsvc.getLog().error("#import(): Error [path=" + path + ", error=" + e + "].");
            return false;
        }

        // finally render the template
        try {
            context.pushCurrentTemplateName(path);
            ((SimpleNode)t.getData()).render(context, writer);

        } catch (Throwable th) {
            rsvc.getLog().error("Exception rendering #import(" + path + "): " + th);
            // we want to pass method invocation exceptions through
            if (th instanceof MethodInvocationException) {
                throw (MethodInvocationException)th;
            }
            return false;

        } finally {
            context.popCurrentTemplateName();
        }

        return true;
    }