/** * Register arguments. * @return void */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('query', 'string|array', 'Solr querystring or array of query fields and their query values.', TRUE); $this->registerArgument('operator', 'string', 'Solr query operator.', FALSE, 'AND'); $this->registerArgument('sortField', 'string', 'Sort field.', FALSE); $this->registerArgument('sortOrder', 'string', 'Sort order ("asc" or "desc").', FALSE, 'asc'); $this->registerArgument('rows', 'integer', 'Number of rows to be returned.', FALSE); $this->registerArgument('fields', 'string', 'Fields to be returned, comma seperated if more than one field.', FALSE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('pattern', 'string', 'regex pattern to match string against', TRUE); $this->registerArgument('string', 'string', 'string to match with the regex pattern', TRUE); $this->registerArgument('global', 'boolean', 'match global', FALSE, FALSE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('pageUid', 'integer', 'value to check', FALSE, NULL); $this->registerArgument('includeHidden', 'boolean', 'include hidden pages', FALSE, FALSE); $this->registerArgument('showHiddenInMenu', 'boolean', 'include pages hidden in menu', FALSE, FALSE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('pageUid', 'integer', 'Parent page to check', false, null); $this->registerArgument('includeHidden', 'boolean', 'DEPRECATED: Include hidden pages', false, false); $this->registerArgument('includeAccessProtected', 'boolean', 'Include access protected pages', false, false); $this->registerArgument('includeHiddenInMenu', 'boolean', 'Include pages hidden in menu', false, false); $this->registerArgument('showHiddenInMenu', 'boolean', 'DEPRECATED: Use includeHiddenInMenu', false, false); }
/** * @test */ public function elseArgumentHasPriorityOverChildNodesIfConditionIsFalse() { $mockElseViewHelperNode = $this->getMock(\TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\ViewHelperNode::class, array('getViewHelperClassName', 'evaluate', 'setRenderingContext'), array(), '', false); $mockElseViewHelperNode->expects($this->any())->method('getViewHelperClassName')->will($this->returnValue(\TYPO3\CMS\Fluid\ViewHelpers\ElseViewHelper::class)); $mockElseViewHelperNode->expects($this->never())->method('evaluate'); $this->viewHelper->setChildNodes(array($mockElseViewHelperNode)); $this->arguments['else'] = 'ElseArgument'; $this->injectDependenciesIntoViewHelper($this->viewHelper); $actualResult = $this->viewHelper->_call('renderElseChild'); $this->assertEquals('ElseArgument', $actualResult); }
/** * Initialize arguments * * @return void */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('file', 'string', 'Filename which must exist to trigger f:then rendering', FALSE); $this->registerArgument('directory', 'string', 'Directory which must exist to trigger f:then rendering', FALSE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('string', 'string', 'string to check', TRUE); $this->registerArgument('fullString', 'string', 'need', FALSE, FALSE); }
public function initializeArguments() { $this->registerArgument('newsItem', 'object', 'News item', false); parent::initializeArguments(); }
public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('domainObject', 'object', '', true); $this->registerArgument('renderCondition', 'string', '', true); }
/** * renders <f:then> child if $condition is true, otherwise renders <f:else> child. * * @param bool $condition View helper condition * @return string the rendered string * @api */ public function render($condition) { return parent::render(); }
/** * Override: forcibly disables page caching - a TRUE condition * in this ViewHelper means page content would be depending on * the current visitor's session/cookie/auth etc. * * Returns value of "then" attribute. * If then attribute is not set, iterates through child nodes and renders ThenViewHelper. * If then attribute is not set and no ThenViewHelper and no ElseViewHelper is found, all child nodes are rendered * * @return string rendered ThenViewHelper or contents of <f:if> if no ThenViewHelper was found * @api */ protected function renderThenChild() { if ('FE' === TYPO3_MODE) { $GLOBALS['TSFE']->no_cache = 1; } return parent::renderThenChild(); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('value', 'mixed', 'value to check', TRUE); $this->registerArgument('class', 'mixed', 'className to check against', TRUE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('extensionName', 'string', 'Name of extension that must be loaded in order to evaluate as TRUE, UpperCamelCase', TRUE); }
/** * Initialize all arguments. You need to override this method and call * $this->registerArgument(...) inside this method, to register all your arguments. * * @return void */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('condition', 'mixed', 'View helper condition expression, evaled', TRUE); }
/** * Constructor */ public function __construct() { parent::__construct(); $this->registerArgument('property', 'string', 'Property to validate', true); }
/** * Register arguments. * @return void */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('highlighting', 'array', 'Result array with highlighting per document', TRUE); $this->registerArgument('id', 'string', 'document id to check', TRUE); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('language', 'string', 'language to check', true); $this->registerArgument('defaultTitle', 'string', 'title of the default language', false, 'en'); }
/** * Override: forcibly disables page caching - a TRUE condition * in this ViewHelper means page content would be depending on * the current visitor's session/cookie/auth etc. * * Returns value of "then" attribute. * If then attribute is not set, iterates through child nodes and renders ThenViewHelper. * If then attribute is not set and no ThenViewHelper and no ElseViewHelper is found, all child nodes are rendered * * @return string rendered ThenViewHelper or contents of <f:if> if no ThenViewHelper was found * @api */ protected function renderThenChild() { if (TRUE === $this->isFrontendContext()) { $GLOBALS['TSFE']->no_cache = 1; } return parent::renderThenChild(); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('value', 'string', 'value to check', TRUE); }
/** * Override: forcibly disables page caching - a TRUE condition * in this ViewHelper means page content would be depending on * the current visitor's session/cookie/auth etc. * * Returns value of "then" attribute. * If then attribute is not set, iterates through child nodes and renders ThenViewHelper. * If then attribute is not set and no ThenViewHelper and no ElseViewHelper is found, all child nodes are rendered * * @return string rendered ThenViewHelper or contents of <f:if> if no ThenViewHelper was found * @api */ protected function renderThenChild() { $GLOBALS['TSFE']->no_cache = 1; return parent::renderThenChild(); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('haystack', 'string', 'haystack', TRUE); $this->registerArgument('needle', 'string', 'need', TRUE); }
/** * The compiled ViewHelper adds two new ViewHelper arguments: __thenClosure and __elseClosure. * These contain closures which are be executed to render the then(), respectively else() case. * * @param string $argumentsVariableName * @param string $renderChildrenClosureVariableName * @param string $initializationPhpCode * @param \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode * @param \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler * @return string * @internal */ public function compile($argumentsVariableName, $renderChildrenClosureVariableName, &$initializationPhpCode, \TYPO3\CMS\Fluid\Core\Parser\SyntaxTree\AbstractNode $syntaxTreeNode, \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler $templateCompiler) { parent::compile($argumentsVariableName, $renderChildrenClosureVariableName, $initializationPhpCode, $syntaxTreeNode, $templateCompiler); return \TYPO3\CMS\Fluid\Core\Compiler\TemplateCompiler::SHOULD_GENERATE_VIEWHELPER_INVOCATION; }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('name', 'string', 'name of the variable', true); }
/** * renders <f:then> child if the current logged in FE user belongs to the specified role (aka usergroup) * otherwise renders <f:else> child. * * @param string $role The usergroup (either the usergroup uid or its title) * @return string the rendered string * @api */ public function render($role) { return parent::render(); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('string', 'string', 'string to check', true); $this->registerArgument('fullString', 'string', 'need', false, false); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('pageUid', 'integer', 'value to check', false, null); $this->registerArgument('respectSiteRoot', 'boolean', 'value to check', false, false); }
/** * Initialize arguments */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('value', 'mixed', 'value to check', true); }
/** * Registers own arguments. */ public function initializeArguments() { parent::initializeArguments(); $this->registerArgument('haystacks', 'string|array', 'Haystack to search', TRUE); $this->registerArgument('needle', 'string', 'Needle to be searched', TRUE); }