本文整理汇总了PHP中TYPO3\Flow\Mvc\ActionRequest::setArgumentNamespace方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionRequest::setArgumentNamespace方法的具体用法?PHP ActionRequest::setArgumentNamespace怎么用?PHP ActionRequest::setArgumentNamespace使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\Flow\Mvc\ActionRequest
的用法示例。
在下文中一共展示了ActionRequest::setArgumentNamespace方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
/**
* @param \TYPO3\Form\Core\Model\FormDefinition $formDefinition
* @param \TYPO3\Flow\Mvc\ActionRequest $request
* @param \TYPO3\Flow\Http\Response $response
* @throws \TYPO3\Form\Exception\IdentifierNotValidException
* @internal
*/
public function __construct(\TYPO3\Form\Core\Model\FormDefinition $formDefinition, \TYPO3\Flow\Mvc\ActionRequest $request, \TYPO3\Flow\Http\Response $response)
{
$this->formDefinition = $formDefinition;
$rootRequest = $request->getMainRequest() ?: $request;
$pluginArguments = $rootRequest->getPluginArguments();
$this->request = new ActionRequest($request);
$formIdentifier = $this->formDefinition->getIdentifier();
$this->request->setArgumentNamespace('--' . $formIdentifier);
if (isset($pluginArguments[$formIdentifier])) {
$this->request->setArguments($pluginArguments[$formIdentifier]);
}
$this->response = $response;
}
示例2: buildPluginRequest
/**
* Build the proper pluginRequest to render the PluginView
* of some configured Master Plugin
*
* @return ActionRequest
*/
protected function buildPluginRequest()
{
/** @var $parentRequest ActionRequest */
$parentRequest = $this->tsRuntime->getControllerContext()->getRequest();
$pluginRequest = new ActionRequest($parentRequest);
if (!$this->pluginViewNode instanceof NodeInterface) {
$pluginRequest->setArgumentNamespace('--' . $this->getPluginNamespace());
$this->passArgumentsToPluginRequest($pluginRequest);
$pluginRequest->setControllerPackageKey($this->getPackage());
$pluginRequest->setControllerSubpackageKey($this->getSubpackage());
$pluginRequest->setControllerName($this->getController());
$pluginRequest->setControllerActionName($this->getAction());
return $pluginRequest;
}
$pluginNodeIdentifier = $this->pluginViewNode->getProperty('plugin');
if (strlen($pluginNodeIdentifier) === 0) {
return $pluginRequest;
}
// Set the node to render this to the master plugin node
$this->node = $this->pluginViewNode->getContext()->getNodeByIdentifier($pluginNodeIdentifier);
if ($this->node === null) {
return $pluginRequest;
}
$pluginRequest->setArgument('__node', $this->node);
$pluginRequest->setArgumentNamespace('--' . $this->getPluginNamespace());
$this->passArgumentsToPluginRequest($pluginRequest);
if ($pluginRequest->getControllerObjectName() !== '') {
return $pluginRequest;
}
$controllerObjectPairs = array();
$pluginViewName = $this->pluginViewNode->getProperty('view');
foreach ($this->pluginService->getPluginViewDefinitionsByPluginNodeType($this->node->getNodeType()) as $pluginViewDefinition) {
/** @var PluginViewDefinition $pluginViewDefinition */
if ($pluginViewDefinition->getName() !== $pluginViewName) {
continue;
}
$controllerObjectPairs = $pluginViewDefinition->getControllerActionPairs();
break;
}
if ($controllerObjectPairs === array()) {
return $pluginRequest;
}
$defaultControllerObjectName = key($controllerObjectPairs);
$defaultActionName = current($controllerObjectPairs[$defaultControllerObjectName]);
$pluginRequest->setControllerObjectName($defaultControllerObjectName);
$pluginRequest->setControllerActionName($defaultActionName);
return $pluginRequest;
}
示例3: indexAction
/**
* @param array $module
* @return mixed
*/
public function indexAction(array $module)
{
$moduleRequest = new ActionRequest($this->request);
$moduleRequest->setArgumentNamespace('moduleArguments');
$moduleRequest->setControllerObjectName($module['controller']);
$moduleRequest->setControllerActionName($module['action']);
if (isset($module['format'])) {
$moduleRequest->setFormat($module['format']);
}
if ($this->request->hasArgument($moduleRequest->getArgumentNamespace()) === true && is_array($this->request->getArgument($moduleRequest->getArgumentNamespace()))) {
$moduleRequest->setArguments($this->request->getArgument($moduleRequest->getArgumentNamespace()));
}
foreach ($this->request->getPluginArguments() as $argumentNamespace => $argument) {
$moduleRequest->setArgument('--' . $argumentNamespace, $argument);
}
$modules = explode('/', $module['module']);
$moduleConfiguration = Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $modules));
$moduleConfiguration['path'] = $module['module'];
if (!$this->menuHelper->isModuleEnabled($moduleConfiguration['path'])) {
throw new DisabledModuleException(sprintf('The module "%s" is disabled. You can enable it with the "enabled" flag in Settings.yaml.', $module['module']), 1437148922);
}
$moduleBreadcrumb = array();
$path = array();
foreach ($modules as $moduleIdentifier) {
array_push($path, $moduleIdentifier);
$config = Arrays::getValueByPath($this->settings['modules'], implode('.submodules.', $path));
$moduleBreadcrumb[implode('/', $path)] = $config;
}
$moduleRequest->setArgument('__moduleConfiguration', $moduleConfiguration);
$moduleResponse = new Response($this->response);
$this->dispatcher->dispatch($moduleRequest, $moduleResponse);
if ($moduleResponse->hasHeader('Location')) {
$this->redirectToUri($moduleResponse->getHeader('Location'), 0, $moduleResponse->getStatusCode());
} elseif ($moduleRequest->getFormat() !== 'html') {
$mediaType = MediaTypes::getMediaTypeFromFilename('file.' . $moduleRequest->getFormat());
if ($mediaType !== 'application/octet-stream') {
$this->controllerContext->getResponse()->setHeader('Content-Type', $mediaType);
}
return $moduleResponse->getContent();
} else {
$user = $this->securityContext->getPartyByType('TYPO3\\Neos\\Domain\\Model\\User');
$sites = $this->menuHelper->buildSiteList($this->controllerContext);
$this->view->assignMultiple(array('moduleClass' => implode('-', $modules), 'moduleContents' => $moduleResponse->getContent(), 'title' => $moduleRequest->hasArgument('title') ? $moduleRequest->getArgument('title') : $moduleConfiguration['label'], 'rootModule' => array_shift($modules), 'submodule' => array_shift($modules), 'moduleConfiguration' => $moduleConfiguration, 'moduleBreadcrumb' => $moduleBreadcrumb, 'user' => $user, 'modules' => $this->menuHelper->buildModuleList($this->controllerContext), 'sites' => $sites));
}
}
示例4: buildPluginRequest
/**
* Build the pluginRequest object
*
* @return ActionRequest
*/
protected function buildPluginRequest()
{
/** @var $parentRequest ActionRequest */
$parentRequest = $this->tsRuntime->getControllerContext()->getRequest();
$pluginRequest = new ActionRequest($parentRequest);
$pluginRequest->setArgumentNamespace('--' . $this->getPluginNamespace());
$this->passArgumentsToPluginRequest($pluginRequest);
if ($this->node instanceof NodeInterface) {
$pluginRequest->setArgument('__node', $this->node);
if ($pluginRequest->getControllerPackageKey() === NULL) {
$pluginRequest->setControllerPackageKey($this->node->getProperty('package') ?: $this->getPackage());
}
if ($pluginRequest->getControllerSubpackageKey() === NULL) {
$pluginRequest->setControllerSubpackageKey($this->node->getProperty('subpackage') ?: $this->getSubpackage());
}
if ($pluginRequest->getControllerName() === NULL) {
$pluginRequest->setControllerName($this->node->getProperty('controller') ?: $this->getController());
}
if ($pluginRequest->getControllerActionName() === NULL) {
$actionName = $this->node->getProperty('action');
if ($actionName === NULL || $actionName === '') {
$actionName = $this->getAction() !== NULL ? $this->getAction() : 'index';
}
$pluginRequest->setControllerActionName($actionName);
}
$pluginRequest->setArgument('__node', $this->node);
$pluginRequest->setArgument('__documentNode', $this->documentNode);
} else {
$pluginRequest->setControllerPackageKey($this->getPackage());
$pluginRequest->setControllerSubpackageKey($this->getSubpackage());
$pluginRequest->setControllerName($this->getController());
$pluginRequest->setControllerActionName($this->getAction());
}
foreach ($this->properties as $key => $value) {
$pluginRequest->setArgument('__' . $key, $this->tsValue($key));
}
return $pluginRequest;
}
示例5: argumentNamespaceCanBeSpecified
/**
* @test
*/
public function argumentNamespaceCanBeSpecified()
{
$this->assertSame('', $this->actionRequest->getArgumentNamespace());
$this->actionRequest->setArgumentNamespace('someArgumentNamespace');
$this->assertSame('someArgumentNamespace', $this->actionRequest->getArgumentNamespace());
}
示例6: argumentNamespaceCanBeSpecified
/**
* @test
*/
public function argumentNamespaceCanBeSpecified()
{
$httpRequest = HttpRequest::create(new Uri('http://localhost'));
$actionRequest = new ActionRequest($httpRequest);
$this->assertSame('', $actionRequest->getArgumentNamespace());
$actionRequest->setArgumentNamespace('someArgumentNamespace');
$this->assertSame('someArgumentNamespace', $actionRequest->getArgumentNamespace());
}