Renders the menu wrapper and it's content.

@param array $data options and content of the wrapper
@return string rendered wrapper
975486
public function render($data)
    {
        if (isset($data['content'])) {
            $this->config(['content' => $data['content']]);
            $content = new MenuContent($this->config(), $this->_here);
            $group = isset($data['group'])? $data['group'] : null;
            $contents = $content->render($group);
            $this->_active = $this->_active || $content->active();
            $this->config('wrapper.wrapper', $contents);
        }

        if ($this->_active) {
            $class = $this->config('wrapper.class') . ' active';
            $this->config('wrapper.class', $class);
        }

        return $this->formatTemplate('wrapper', $this->config('wrapper'));
    }
1023072
protected function renderItem($item) {
        $linkTemplate = empty($item['items']) ? $this->linkTemplate : $this->itemSubmenuLinkTemplate;
        $labelTemplate = empty($item['items']) ? $this->labelTemplate : $this->itemSubmenuLabelTemplate;

        if (isset($item['url'])) {
            $template = ArrayHelper::getValue($item, 'template', $linkTemplate);

            $params = [
                '{url}' => Html::encode(Url::to($item['url'])),
                '{label}' => $item['label'],
                '{icon}' => isset($item['icon']) ? "<i class='{$item['icon']}'></i>" : '',
            ];

            return strtr($template, $params);
        } else {
            $template = ArrayHelper::getValue($item, 'template', $labelTemplate);

            return strtr($template, [
                '{label}' => $item['label'],
                '{icon}' => isset($item['icon']) ? "<i class='{$item['icon']}'></i>" : '',
            ]);
        }
    }
771440
protected function displayRenderers($data)
    {
        $div_tag = new SwatHtmlTag('div');
        $div_tag->open();

        foreach ($this->renderers as $renderer) {
            $renderer->render();
            echo ' ';
        }

        $div_tag->close();
    }
1028049
private function prepareContent($data)
    {
        $content = '';

        foreach ($data as $row) {
            $content .= $this->convertToJson($row) . static::ROW_DELIMITER;
        }

        return $content;
    }
1316315
public function compile(array $data = []): string {
		
		// this is our most basic version of a compilation.  it
		// simply assumes that whatever information we have in our
		// data (either the argument or the combination of it and
		// the data property) should just get crammed into our
		// content.  we expect that more complicated views will
		// require more work and so they can overwrite this method.
		
		if ($this->compiled) {
			throw new ViewException("Attempt to recompile view.", ViewException::RECOMPILATION);
		}
		
		// for the convenience of our programmers, we'll let more
		// data be added here -- or maybe it'll be the only way
		// someone adds data.
		
		$this->setData($data);
		
		// now, we'll want to merge our header and footer and put
		// content in the middle.  if we've not received specific
		// content, we just assume it'll be found in our data.
		// then, we can apply our template compiler
		
		if (empty($this->content)) {
			$this->setContent('$content');
		}
		
		$this->compilation = View::compileTemplate(
			($this->header . $this->content . $this->footer),
			$this->data);
		
		// so that we lock our view after compilation, we'll set the
		// compiled flag and then return the content to the calling
		// scope.
		
		$this->compiled = true;
		return $this->compilation;
	}
1308503
static public function wrap($data, $wrap='xml')
    {
        if (is_string($data)) {
            return '<' . $wrap . '>' . $data . '</' . $wrap . '>';
        } elseif (is_array($data)) {
            return [$wrap => $data];
        }
        return $data;
    }
1189369
public function renderMessageBox($data=null)
	{
	    $needData = [
	        'url'      => '_stop',
	        'rootUrl'  => Config::getRootUrl(),
	        'errtype'  => '提示'
	    ];
	    
	    $data = $data ? : [];
	    $data = array_merge($needData, $data);
	    $template = $this->getMessageBoxTemplate();
	    return $this->setLayout(null)->render($template, $data);
	}
760537
public function render(array $data, ContextInterface $context)
    {
        $data += ['class' => ''];
        $data['class'] .= ' filled-in ';
        $data['class'] = trim($data['class']);

        return parent::render($data, $context);
    }
239335
protected function renderLogin(array $data)
    {
        $template = sprintf(
            'FOSUserBundle:Security:login.html.%s',
            $this->container->getParameter('fos_user.template.engine')
        );

        return $this->container->get('templating')->renderResponse($template, $data);
    }
956115
public function renderValue($data, array $options = []) : string
    {
        $options = array_merge($this->defaultOptions, $this->fixOptions($options));
        $result = $this->getFieldValueFromData($data, $options);

        // Currently needed for blobs from the database, but might be handy later
        // for network data and such.
        // TODO: Add support for encoding (base64, et) via $options
        if (is_resource($result)) {
            $result = stream_get_contents($result);
        }

        $rendererClass = $this->config->getProvider('renderValue');
        if (!empty($options['renderAs'])) {
            $rendererClass = __NAMESPACE__ . '\\Provider\\RenderValue\\' . ucfirst($options['renderAs']) . 'Renderer';
        }

        if (!class_exists($rendererClass)) {
            throw new InvalidArgumentException("Renderer class [$rendererClass] does not exist");
        }

        $rendererClass = new $rendererClass($this->config);
        $result = (string)$rendererClass->provide($result, $options);

        return $result;
    }
1266277
public function render($name, $data = array())
    {
        // Assign to double underscored variables to avoid conflict with view parameters
        $__file = $this->getFile($name);
        $__data = $data + $this->data;
        $__layout = $this->layout;

        // Render view
        extract($__data, EXTR_OVERWRITE);
        ob_start();
        try {
            require $__file;
        } catch (\Exception $e) {
            ob_end_clean();
            throw $e;
        }
        $content = ob_get_clean();

        // If layout is configured, render layout
        if ($__layout != $this->layout) {
            $layout = $this->layout;
            $this->layout = array();
            $__data[$layout['variable']] = $content;
            $content = $this->render($layout['name'], $__data);
        }

        return $content;
    }
559230
protected function renderLogin(array $data)
    {
        $response = new Response();
        $response->headers->add(array('X-Form-Type' => 'login'));

        return $this->render('FOSUserBundle:Security:login.html.twig', $data, $response);
    }
796728
protected function doRender($data)
    {
        if ($data instanceof Structure) {
            return $data->toString($this->format, (array) $this->config->get('options', []));
        }

        return Arr::dump($data, $this->config->get('options.level', 5));
    }
563252
public function transform($data)
    {
        $output = $data;
        if (is_array($data)) {
            $output = "<ul>";
            foreach ($data as $item) {
                $output .= "<li>" . $this->transform($item) . "</li>";
            }
            $output .= "</ul>";
        }

        return $output;
    }
895146
public function render($fileName, $data = [])
    {
        $content = $this->renderParticle($fileName, $data);
        if ($this->layout) {
            ob_start();
            ob_implicit_flush(false);
            $layout = $this->getLayoutPath();
            require $layout;
            return ob_get_clean();
        } else {
            return $content;
        }
    }
1129533
final public function render($data = array())
    {
        $context = $this->getContext();
        $context->data = array_merge($this->getData(), $data);

        if ($this->invokeCommand('before.render', $context) !== false)
        {
            //Render the view
            $context->result = $this->_actionRender($context);
            $this->invokeCommand('after.render', $context);
        }

        //Set the content
        $this->setContent($context->result);

        return $context->result;
    }
1163608
public function renderItem($item)
    {
        $options = ArrayHelper::getValue($item, 'options', array());
        if (isset($item['featured'])) {
            Html::addCssClass($this->htmlOptions, Enum::ClEARING_FEATURE);
            Html::addCssClass($options, Enum::CLEARING_FEATURE_IMG);
        }
        $imgOptions                 = array();
        $imgOptions['src']          = ArrayHelper::getValue($item, 'th', '#');
        $imgOptions['data-caption'] = ArrayHelper::getValue($item, 'caption', null);
        $imgOptions['class']        = 'th';
        $url                        = ArrayHelper::getValue($item, 'img', '#');

        return \CHtml::tag('li', $options, \CHtml::link(\CHtml::tag('img', $imgOptions), $url));

    }