本文整理汇总了PHP中TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface类的典型用法代码示例。如果您正苦于以下问题:PHP RenderingContextInterface类的具体用法?PHP RenderingContextInterface怎么用?PHP RenderingContextInterface使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了RenderingContextInterface类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderStatic
/**
* Default implementation for use in compiled templates
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return mixed
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
if (self::$staticReflectionService === NULL) {
$objectManager = GeneralUtility::makeInstance('TYPO3\\CMS\\Extbase\\Object\\ObjectManager');
self::$staticReflectionService = $objectManager->get('TYPO3\\CMS\\Extbase\\Reflection\\ReflectionService');
}
$property = $arguments['property'];
$validatorName = isset($arguments['validatorName']) ? $arguments['validatorName'] : NULL;
$object = isset($arguments['object']) ? $arguments['object'] : NULL;
if (NULL === $object) {
$object = self::getFormObject($renderingContext->getViewHelperVariableContainer());
}
$className = get_class($object);
if (FALSE !== strpos($property, '.')) {
$pathSegments = explode('.', $property);
foreach ($pathSegments as $property) {
if (TRUE === ctype_digit($property)) {
continue;
}
$annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'var');
$possibleClassName = array_pop($annotations);
if (FALSE !== strpos($possibleClassName, '<')) {
$className = array_pop(explode('<', trim($possibleClassName, '>')));
} elseif (TRUE === class_exists($possibleClassName)) {
$className = $possibleClassName;
}
}
}
$annotations = self::$staticReflectionService->getPropertyTagValues($className, $property, 'validate');
$hasEvaluated = TRUE;
if (0 < count($annotations) && (NULL === $validatorName || TRUE === in_array($validatorName, $annotations))) {
return static::renderStaticThenChild($arguments, $hasEvaluated);
}
return static::renderStaticElseChild($arguments, $hasEvaluated);
}
示例2: renderStatic
/**
* @param array $arguments
* @param callable $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
*
* @return mixed|string
* @throws Exception
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$value = $arguments['value'];
$default = $arguments['default'];
$viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
if (!$viewHelperVariableContainer->exists(SwitchViewHelper::class, 'stateStack')) {
throw new Exception('The case View helper can only be used within a switch View helper', 1368112037);
}
if (is_null($value) && $default === false) {
throw new Exception('The case View helper must have either value or default argument', 1382867521);
}
$stateStack = $viewHelperVariableContainer->get(SwitchViewHelper::class, 'stateStack');
$currentState = array_pop($stateStack);
if ($currentState['break'] === true) {
return '';
}
// non-type-safe comparison by intention
if ($default === true || $currentState['expression'] == $value) {
$currentState['break'] = true;
$stateStack[] = $currentState;
$viewHelperVariableContainer->addOrUpdate(SwitchViewHelper::class, 'stateStack', $stateStack);
return $renderChildrenClosure();
}
return '';
}
示例3: renderStatic
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$templateVariableContainer = $renderingContext->getTemplateVariableContainer();
if ($arguments['uid'] !== null && $arguments['table'] !== null) {
$cObj = GeneralUtility::makeInstance('TYPO3\\CMS\\Frontend\\ContentObject\\ContentObjectRenderer');
$whereClause = '1 AND `' . $arguments['foreignField'] . '` = \'' . $arguments['uid'] . '\' ' . $arguments['additionalWhere'] . $cObj->enableFields($arguments['table']);
$groupBy = '';
$limit = '';
$GLOBALS['TYPO3_DB']->store_lastBuiltQuery = 1;
$data = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows($arguments['selectFields'], $arguments['table'], $whereClause, $groupBy, $arguments['sortby'], $limit);
$items = array();
foreach ($data as $record) {
$GLOBALS['TSFE']->sys_page->versionOL($arguments['table'], $record);
if (is_array($record)) {
$items[] = $GLOBALS['TSFE']->sys_page->getRecordOverlay($arguments['table'], $record, $GLOBALS['TSFE']->sys_language_uid);
}
}
usort($items, array(self, "orderBySorting"));
} else {
$items = null;
}
$templateVariableContainer->add($arguments['as'], $items);
$content = $renderChildrenClosure();
$templateVariableContainer->remove($arguments['as']);
return $content;
}
示例4: renderStatic
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return void
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$viewHelperVariableContainer = $renderingContext->getViewHelperVariableContainer();
$templateVariableContainer = $renderingContext->getTemplateVariableContainer();
$extensionName = static::getExtensionNameFromRenderingContextOrArguments($renderingContext, $arguments);
$formClassName = FluxPackageFactory::getPackageWithFallback($extensionName)->getImplementation(FluxPackage::IMPLEMENTATION_FORM);
$form = call_user_func_array(array($formClassName, 'create'), array());
$container = $form->last();
// configure Form instance
$form->setId($arguments['id']);
$form->setName($arguments['id']);
$form->setLabel($arguments['label']);
$form->setDescription($arguments['description']);
$form->setEnabled($arguments['enabled']);
$form->setCompact($arguments['compact']);
$form->setExtensionName($extensionName);
$form->setLocalLanguageFileRelativePath($arguments['localLanguageFileRelativePath']);
$form->setVariables((array) $arguments['variables']);
$form->setOptions((array) $arguments['options']);
if (FALSE === $form->hasOption(Form::OPTION_ICON)) {
$form->setOption(Form::OPTION_ICON, $arguments['icon']);
}
if (FALSE === $form->hasOption(Form::OPTION_GROUP)) {
$form->setOption(Form::OPTION_GROUP, $arguments['wizardTab']);
}
// rendering child nodes with Form's last sheet as active container
$viewHelperVariableContainer->addOrUpdate(static::SCOPE, static::SCOPE_VARIABLE_FORM, $form);
$viewHelperVariableContainer->addOrUpdate(static::SCOPE, static::SCOPE_VARIABLE_EXTENSIONNAME, $extensionName);
$templateVariableContainer->add(static::SCOPE_VARIABLE_FORM, $form);
static::setContainerInRenderingContext($renderingContext, $container);
$renderChildrenClosure();
$viewHelperVariableContainer->remove(static::SCOPE, static::SCOPE_VARIABLE_EXTENSIONNAME);
$viewHelperVariableContainer->remove(static::SCOPE, static::SCOPE_VARIABLE_CONTAINER);
$templateVariableContainer->remove(static::SCOPE_VARIABLE_CONTAINER);
}
示例5: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
$output0 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\CommentViewHelper
$arguments1 = array();
$renderChildrenClosure2 = function () use($renderingContext, $self) {
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
return ' Only used for lib.stdheader purposes. ';
};
$output0 .= '';
$output0 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments3 = array();
$arguments3['partial'] = 'Header';
$arguments3['arguments'] = $currentVariableContainer->getOrNull('_all');
$arguments3['section'] = NULL;
$arguments3['optional'] = false;
$renderChildrenClosure4 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments3, $renderChildrenClosure4, $renderingContext);
$output0 .= '
';
return $output0;
}
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:33,代码来源:Standalone_template_file_HeaderOnly_d566f514576a96bde50d5b79b6fcb29435c17655.php
示例6: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
$output0 .= '<div class="typo3-documentation">
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments1 = array();
$arguments1['section'] = 'module-headline';
$arguments1['partial'] = NULL;
$arguments1['arguments'] = array();
$arguments1['optional'] = false;
$renderChildrenClosure2 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments1, $renderChildrenClosure2, $renderingContext);
$output0 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments3 = array();
$arguments3['section'] = 'Content';
$arguments3['partial'] = NULL;
$arguments3['arguments'] = array();
$arguments3['optional'] = false;
$renderChildrenClosure4 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments3, $renderChildrenClosure4, $renderingContext);
$output0 .= '
</div>
';
return $output0;
}
开发者ID:Lamperg,项目名称:typo3.train,代码行数:37,代码来源:Documentation_Document_layout_Default_f1a4b459b48a6088df27851553a84a0c8aafd643.php
示例7: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments1 = array();
$arguments1['section'] = 'content';
$arguments1['partial'] = NULL;
$arguments1['arguments'] = array();
$arguments1['optional'] = false;
$renderChildrenClosure2 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments1, $renderChildrenClosure2, $renderingContext);
$output0 .= '
<hr />
<p>
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Format\RawViewHelper
$arguments3 = array();
$arguments3['value'] = NULL;
$renderChildrenClosure4 = function () use($renderingContext, $self) {
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
return $currentVariableContainer->getOrNull('copyright');
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\Format\RawViewHelper::renderStatic($arguments3, $renderChildrenClosure4, $renderingContext);
$output0 .= '
</p>
';
return $output0;
}
开发者ID:Lamperg,项目名称:typo3.train,代码行数:36,代码来源:Cshmanual_Help_layout_Default_ccb97a2a04cc4ff0877387b274508d6375289ab3.php
示例8: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper
$arguments1 = array();
$arguments1['title'] = $currentVariableContainer->getOrNull('title');
$arguments1['state'] = $currentVariableContainer->getOrNull('state');
$arguments1['message'] = NULL;
$arguments1['iconName'] = NULL;
$arguments1['disableIcon'] = false;
$renderChildrenClosure2 = function () use($renderingContext, $self) {
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output3 = '';
$output3 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper
$arguments4 = array();
$arguments4['parseFuncTSPath'] = 'lib.parseFunc_RTE';
$renderChildrenClosure5 = function () use($renderingContext, $self) {
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
return $currentVariableContainer->getOrNull('message');
};
$output3 .= TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlViewHelper::renderStatic($arguments4, $renderChildrenClosure5, $renderingContext);
$output3 .= '
';
return $output3;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\Be\InfoboxViewHelper::renderStatic($arguments1, $renderChildrenClosure2, $renderingContext);
$output0 .= '
';
return $output0;
}
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:37,代码来源:Standalone_template_file_InfoBox_b2538f4db1f5a010f844d7cdb7a91cb50d5e8cd1.php
示例9: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
$output0 .= '
<div id="c';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Format\HtmlspecialcharsViewHelper
$arguments1 = array();
$arguments1['value'] = \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ObjectAccessorNode::getPropertyPath($currentVariableContainer->getOrNull('data'), 'uid', $renderingContext);
$arguments1['keepQuotes'] = false;
$arguments1['encoding'] = NULL;
$arguments1['doubleEncode'] = true;
$renderChildrenClosure2 = function () {
return NULL;
};
$value3 = $arguments1['value'] !== NULL ? $arguments1['value'] : $renderChildrenClosure2();
$output0 .= !is_string($value3) ? $value3 : htmlspecialchars($value3, $arguments1['keepQuotes'] ? ENT_NOQUOTES : ENT_COMPAT, $arguments1['encoding'] !== NULL ? $arguments1['encoding'] : \TYPO3\CMS\Fluid\Core\Compiler\AbstractCompiledTemplate::resolveDefaultEncoding(), $arguments1['doubleEncode']);
$output0 .= '">
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments4 = array();
$arguments4['partial'] = 'Header';
$arguments4['arguments'] = $currentVariableContainer->getOrNull('_all');
$arguments4['section'] = NULL;
$arguments4['optional'] = false;
$renderChildrenClosure5 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments4, $renderChildrenClosure5, $renderingContext);
$output0 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments6 = array();
$arguments6['section'] = 'content';
$arguments6['partial'] = NULL;
$arguments6['arguments'] = array();
$arguments6['optional'] = false;
$renderChildrenClosure7 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments6, $renderChildrenClosure7, $renderingContext);
$output0 .= '
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments8 = array();
$arguments8['partial'] = 'Footer';
$arguments8['arguments'] = $currentVariableContainer->getOrNull('_all');
$arguments8['section'] = NULL;
$arguments8['optional'] = false;
$renderChildrenClosure9 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments8, $renderChildrenClosure9, $renderingContext);
$output0 .= '
</div>
';
return $output0;
}
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:62,代码来源:Standalone_layout_HeaderContentFooter_b06d9052a18e398425f137024e37bb59bc4f4a7c.php
示例10: render
/**
* Main Render function
*/
public function render(\TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$self = $this;
$currentVariableContainer = $renderingContext->getTemplateVariableContainer();
$output0 = '';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Be\PageRendererViewHelper
$arguments1 = array();
// Rendering Array
$array2 = array();
$array2['0'] = 'TYPO3/CMS/Recycler/Recycler';
$arguments1['includeRequireJsModules'] = $array2;
$arguments1['pageTitle'] = '';
$arguments1['loadExtJs'] = false;
$arguments1['loadExtJsTheme'] = true;
$arguments1['enableExtJsDebug'] = false;
$arguments1['loadJQuery'] = false;
$arguments1['includeCssFiles'] = NULL;
$arguments1['includeJsFiles'] = NULL;
$arguments1['addJsInlineLabels'] = NULL;
$arguments1['jQueryNamespace'] = NULL;
$renderChildrenClosure3 = function () {
return NULL;
};
$viewHelper4 = $self->getViewHelper('$viewHelper4', $renderingContext, 'TYPO3\\CMS\\Fluid\\ViewHelpers\\Be\\PageRendererViewHelper');
$viewHelper4->setArguments($arguments1);
$viewHelper4->setRenderingContext($renderingContext);
$viewHelper4->setRenderChildrenClosure($renderChildrenClosure3);
// End of ViewHelper TYPO3\CMS\Fluid\ViewHelpers\Be\PageRendererViewHelper
$output0 .= $viewHelper4->initializeArgumentsAndRender();
$output0 .= '
<h1>';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper
$arguments5 = array();
$arguments5['key'] = 'title';
$arguments5['id'] = NULL;
$arguments5['default'] = NULL;
$arguments5['htmlEscape'] = NULL;
$arguments5['arguments'] = NULL;
$arguments5['extensionName'] = NULL;
$renderChildrenClosure6 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\TranslateViewHelper::renderStatic($arguments5, $renderChildrenClosure6, $renderingContext);
$output0 .= '</h1>
';
// Rendering ViewHelper TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper
$arguments7 = array();
$arguments7['section'] = 'content';
$arguments7['partial'] = NULL;
$arguments7['arguments'] = array();
$arguments7['optional'] = false;
$renderChildrenClosure8 = function () {
return NULL;
};
$output0 .= TYPO3\CMS\Fluid\ViewHelpers\RenderViewHelper::renderStatic($arguments7, $renderChildrenClosure8, $renderingContext);
$output0 .= '
';
return $output0;
}
开发者ID:mrmoree,项目名称:vkmh_typo3,代码行数:62,代码来源:Recycler_RecyclerModule_layout_Default_0aef2c7f08663bfcc01fdc0270aa2b111ee6f9f4.php
示例11: prepareContextsForUncachedRendering
/**
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @param \TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext
* @return void
*/
protected function prepareContextsForUncachedRendering(RenderingContextInterface $renderingContext, ControllerContext $controllerContext)
{
$renderingContext->setControllerContext($controllerContext);
$this->setRenderingContext($renderingContext);
$this->templateParser = TemplateParserBuilder::build();
$this->templateCompiler = $this->objectManager->get('TYPO3\\CMS\\Fluid\\Core\\Compiler\\TemplateCompiler');
$this->templateCompiler->setTemplateCache($GLOBALS['typo3CacheManager']->getCache('fluid_template'));
}
示例12: renderStatic
/**
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @return string
* @throws \TYPO3\CMS\Fluid\Core\ViewHelper\Exception
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext)
{
$templateVariableContainer = $renderingContext->getTemplateVariableContainer();
$object = self::getTranslation($arguments['newsItem']->getUid(), $arguments['language']);
$templateVariableContainer->add($arguments['as'], $object);
$output = $renderChildrenClosure();
$templateVariableContainer->remove($arguments['as']);
return $output;
}
示例13: renderStatic
/**
* Checks if the URL is a valid YouTube/Vimeo Link is. If the video id can
* be extracted the embed code will be returned, else the content of the
* ViewHelper will be displayed.
*
* @param array $arguments
* @param \Closure $renderChildrenClosure
* @param RenderingContextInterface $renderingContext
* @return string
*/
public static function renderStatic(array $arguments, \Closure $renderChildrenClosure, RenderingContextInterface $renderingContext)
{
$templateVariableContainer = $renderingContext->getTemplateVariableContainer();
$externalMediaUtility = GeneralUtility::makeInstance('BK2K\\BootstrapPackage\\Utility\\ExternalMediaUtility');
$externalMedia = $externalMediaUtility->getEmbedCode($arguments['url'], $arguments['class']);
$templateVariableContainer->add('externalMedia', $externalMedia);
$content = $renderChildrenClosure();
$templateVariableContainer->remove('externalMedia');
return $content;
}
示例14: renderChildrenWithVariableOrReturnInputStatic
/**
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @param \Closure $renderChildrenClosure
* @return mixed
*/
protected static function renderChildrenWithVariableOrReturnInputStatic($variable = NULL, $as, $renderingContext = NULL, $renderChildrenClosure = NULL)
{
if (TRUE === empty($as)) {
return $variable;
} else {
$variables = array($as => $variable);
$content = static::renderChildrenWithVariablesStatic($variables, $renderingContext->getTemplateVariableContainer(), $renderChildrenClosure);
}
return $content;
}
示例15: renderChildrenWithVariableOrReturnInputStatic
/**
* @param mixed $variable
* @param string $as
* @param \TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext
* @param \Closure $renderChildrenClosure
* @return mixed
*/
protected static function renderChildrenWithVariableOrReturnInputStatic($variable, $as, RenderingContextInterface $renderingContext, \Closure $renderChildrenClosure)
{
if (true === empty($as)) {
return $variable;
} else {
$variables = [$as => $variable];
$content = static::renderChildrenWithVariablesStatic($variables, $renderingContext->getTemplateVariableContainer(), $renderChildrenClosure);
}
return $content;
}