Returns the layout for this view. This will be either
the 'layout' data value, the applications 'layout' configuration
value, or 'layout.php'.

@param array $data Any additonal data to be passed to the template.

@return string|null
556600
public function getLayout($data = null) {
    $layout = null;

    // 1) Check the passed in data
    if (is_array($data) && array_key_exists(self::LAYOUT_KEY, $data)) {
      $layout = $data[self::LAYOUT_KEY];
      unset($data[self::LAYOUT_KEY]);
    }

    // 2) Check the data on the View
    if ($this->has(self::LAYOUT_KEY)) {
      $layout = $this->get(self::LAYOUT_KEY);
      $this->remove(self::LAYOUT_KEY);
    }

    // 3) Check the Slim configuration
    if (is_null($layout)) {
      $app = Slim::getInstance();
      if (isset($app)) {
        $layout = $app->config(self::LAYOUT_KEY);
      }
    }

    // 4) Use the default layout
    if (is_null($layout)) {
      $layout = self::DEFAULT_LAYOUT;
    }

    return $layout;
  }
1040263
public function getDataWrapper($data = null)
    {
        // if $data is set reconstruct the data wrapper
        if (!$this->dataWrapper || $data) {
            $this->dataWrapper = new DataWrapper\ArrayWrapper($data);
        }

        return $this->dataWrapper;
    }
751232
protected function getHtmlTitleFormatForPage(array $data)
    {
        if (empty($data['page']['title'])) {
            return $data['site']['name'];
        }

        return Str::replace($this->formats['page'], $data);
    }
1052302
private function getLayoutName()
    {
        if ($this->layout != null) {
            return $this->layout;
        }

        try {
            return $this->template->exists("backend_layout") ? "backend_layout" : $this->theme . "::layout";
        } catch (\LogicException $ex) {
            return $this->theme . "::layout";
        }
    }
1224330
protected function _getLayoutFileName($name = null)
    {
        try {
            $filename = parent::_getLayoutFileName($name);
        } catch (\Exception $e) {
            $filename = parent::_getLayoutFileName('default');
        }

        return $filename;
    }
1348448
private function parseDocument(array $data)
    {
        $result = null;

        $dataSegment = $this->getArrayValue($data, DocumentInterface::KEYWORD_DATA, null);
        if (empty($dataSegment) === false && is_array($dataSegment) === true) {
            $isProbablySingle = $this->isProbablySingleIdentity($dataSegment);
            $parsed           = $isProbablySingle === true ?
                $this->parseSinglePrimaryData($dataSegment) :
                $this->parseArrayOfPrimaryData($dataSegment);

            if ($parsed !== null) {
                $result = new DocumentObject($parsed);
            }
        } elseif ($dataSegment !== null) {
            $this->errors->addDataError('Invalid element.');
        }

        return $result;
    }
970350
public function image($data)
    {
        $value = isset($data['src']) ? $data['src'] : null;
        $url   = isset($data['url']) ? $data['url'] : null;
        if (!$value) {
            return null;
        }
        
        $params = $url ? ['url' => Ioc::url($url)] : null;
        return HtmlHelper::image($value, $params);
    }
1030363
public function create($data, $layoutId = null)
    {
        if (isset($layoutId)) {
            return $this->client()->put($data, 'layouts/{layoutId}', ['layoutId' => $layoutId]);
        }

        return $this->client()->post($data, 'layouts');
    }
221803
public function render($templateName = null, $data = [])
    {
        $this->setTemplate($templateName, $data);

        if (empty($this->_templateName)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('template name is null');
            }

            throw new \RuntimeException('TEMPLATE_IS_NULL');
        }
        $buffer = $this->_parseTemplate($this->_templateName, $this->_data);
        if (!empty($this->_layout)) {
            if (defined('FOCUS_DEBUG') && FOCUS_DEBUG) {
                $this->getLogger()->debug('loading layout: '.$this->_layout);
            }

            $buffer = $this->_parseTemplate(
                $this->_layout,
                array_merge($this->_data, ['__body__' => $buffer])
            );
        }

        return $buffer;
    }
441291
public function getLayoutName($media = TemplateLayout::MEDIA_SCREEN)
	{
		$templateLayouts = $this->getTemplateLayouts();

		if ($templateLayouts->offsetExists($media)) {
			$templateLayout = $templateLayouts->offsetGet($media);
			/* @var $templateLayout TemplateLayout */

			return $templateLayout->getLayoutName();
		}

		throw new \RuntimeException(sprintf(
				'Template [%s] has no layout for media [%s]',
				$this->getId(),
				$media
		));
	}
1078163
public function user_templateLayout(array &$config)
    {
        $pageId = 0;
        $currentColPos = $config['flexParentDatabaseRow']['colPos'];
        $pageId = $this->getPageId($config['flexParentDatabaseRow']['pid']);
        if ($pageId > 0) {
            $templateLayouts = $this->templateLayoutsUtility->getAvailableTemplateLayouts($pageId);
            $templateLayouts = $this->reduceTemplateLayouts($templateLayouts, $currentColPos);
            foreach ($templateLayouts as $layout) {
                $additionalLayout = [
          htmlspecialchars($this->getLanguageService()->sL($layout[0])),
          $layout[1]
        ];
                array_push($config['items'], $additionalLayout);
            }
        }
    }
759707
public function getDefaultFromData($data)
    {
        if ($this->defaultFrom) {
            return $this->getFieldNameFromData($this->defaultFrom, $data);
        }

        if ($this->defaults !== '') {
            return $this->defaults;
        }

        return null;
    }
40658
public function getConfigData($data = null) {
        if ($data !== null && isset($this->_config[$data])) {
            return $this->_config[$data];
        } elseif ($data === null) {
            return $this->_config;
        } else {
            throw new ConfigException("Error while requesting config value: " . $data);
        }
    }
285812
public function viewContent($layout, $data = array())
    {
        $data = $this->setBodyAttributes($layout, $data);

        return $this->layout->content = view($layout, $data);
    }
82701
public function renderLayout(array $data = null)
    {
        !$data or extract($data);
        ob_start();

        /** @noinspection PhpIncludeInspection */
        if (file_exists(rtrim(
                $this->getLayoutPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            include rtrim(
                    $this->getLayoutPath(), $this->getFileExt()
                ) . $this->getFileExt();

        } elseif (file_exists(rtrim(
                $this->getLayoutFallbackPath(), $this->getFileExt()
            ) . $this->getFileExt())) {

            include rtrim(
                    $this->getLayoutFallbackPath(), $this->getFileExt()
                ) . $this->getFileExt();
        } else {

            throw new ViewNotFoundException('View ' . rtrim(
                    $this->getLayoutPath(), $this->getFileExt()
                ) . $this->getFileExt() . ' not found');
        }

        $rendered = ob_get_contents();
        ob_end_clean();

        return $rendered;
    }
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);
	}
1196355
protected function getLayout(string $layout = null): string
    {
        if ($layout === null) {
            $frontendBridgeComponentExists = isset($this->FrontendBridge);
            $layout = 'FrontendBridge.json_action';

            if ($frontendBridgeComponentExists) {
                $layout = $this->FrontendBridge->config('templatePaths.jsonAction');
            }

            if ($this->request->is('dialog')) {
                $layout = 'FrontendBridge.dialog_action';

                if ($frontendBridgeComponentExists) {
                    $layout = $this->FrontendBridge->config('templatePaths.dialogAction');
                }
            }
        }

        return $layout;
    }