本文整理汇总了PHP中TYPO3\Flow\Http\Request::getArgument方法的典型用法代码示例。如果您正苦于以下问题:PHP Request::getArgument方法的具体用法?PHP Request::getArgument怎么用?PHP Request::getArgument使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Http\Request
的用法示例。
在下文中一共展示了Request::getArgument方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: extractWidgetContext
/**
* Extracts the WidgetContext from the given $httpRequest.
* If the request contains an argument "__widgetId" the context is fetched from the session (AjaxWidgetContextHolder).
* Otherwise the argument "__widgetContext" is expected to contain the serialized WidgetContext (protected by a HMAC suffix)
*
* @param Request $httpRequest
* @return WidgetContext
*/
protected function extractWidgetContext(Request $httpRequest)
{
if ($httpRequest->hasArgument('__widgetId')) {
return $this->ajaxWidgetContextHolder->get($httpRequest->getArgument('__widgetId'));
} elseif ($httpRequest->hasArgument('__widgetContext')) {
$serializedWidgetContextWithHmac = $httpRequest->getArgument('__widgetContext');
$serializedWidgetContext = $this->hashService->validateAndStripHmac($serializedWidgetContextWithHmac);
return unserialize(base64_decode($serializedWidgetContext));
}
return null;
}
示例2: prepareNodeSelectionFromNode
/**
* Get array of node selection properties
*
*
*
* @param Node $node
* @return array
*/
public function prepareNodeSelectionFromNode(Node $node)
{
foreach ($this->contentContextFactory->getInstances() as $context) {
$this->workspace = $context->getWorkspace();
break;
}
$limit = false;
$limit_param_name = false;
$offset = false;
$offset_param_name = false;
$filter = array();
$sort = array();
$nodetype = false;
$nodetypeisabstract = false;
$entryNodes = array();
$nodeParentPath = $node->getParentPath();
if ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes')) {
// calculate nodetype name
if ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes') && array_key_exists('nodeType', $node->getNodeData()->getNodeType()->getConfiguration('indexedNodes'))) {
foreach ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes')['nodeType'] as $key => $value) {
switch ($key) {
case 'property':
if ($node->getProperty($value)) {
$nodetype = $node->getProperty($value);
}
break;
case 'value':
$nodetype = $value;
break;
case 'param':
if ($this->httpRequest->hasArgument($value) || $nodetype == false) {
$nodetype = addslashes($this->httpRequest->getArgument($value));
}
break;
case 'abstract':
$nodetypeisabstract = TRUE;
break;
default:
break;
}
}
} else {
throw new IndexedNodesException($node->getNodeData()->getNodeType()->getName() . ' has no nodeType definition.');
}
// calculate limit
if ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes') && array_key_exists('limit', $node->getNodeData()->getNodeType()->getConfiguration('indexedNodes'))) {
foreach ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes')['limit'] as $key => $value) {
switch ($key) {
case 'property':
if ($node->getProperty($value)) {
$limit = $node->getProperty($value);
}
break;
case 'value':
$limit = $value;
break;
case 'param':
if ($this->httpRequest->hasArgument($value) || $limit == false) {
$limit = addslashes($this->httpRequest->getArgument($value));
}
$limit_param_name = $value;
if (strlen($limit) == 0) {
$limit = false;
}
break;
default:
break;
}
}
}
if (!$limit) {
// fetch default limit from internal params
$value = "_limit-" . $node->getIdentifier();
if ($this->httpRequest->hasArgument($value)) {
$limit = addslashes($this->httpRequest->getArgument($value));
}
if (!$limit_param_name) {
$limit_param_name = $value;
}
}
// calculate limit offset, if limit isset
if ($limit && $node->getNodeData()->getNodeType()->getConfiguration('indexedNodes') && array_key_exists('offset', $node->getNodeData()->getNodeType()->getConfiguration('indexedNodes'))) {
foreach ($node->getNodeData()->getNodeType()->getConfiguration('indexedNodes')['offset'] as $key => $value) {
switch ($key) {
case 'property':
if ($node->getProperty($value)) {
$offset = $node->getProperty($value);
}
break;
case 'value':
$offset = $value;
break;
//.........这里部分代码省略.........