本文整理汇总了PHP中TYPO3\CMS\Extbase\Mvc\Controller\ActionController::processRequest方法的典型用法代码示例。如果您正苦于以下问题:PHP ActionController::processRequest方法的具体用法?PHP ActionController::processRequest怎么用?PHP ActionController::processRequest使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TYPO3\CMS\Extbase\Mvc\Controller\ActionController
的用法示例。
在下文中一共展示了ActionController::processRequest方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: invokeModuleController
/**
* Call a sub-module's controller
*
*/
protected function invokeModuleController()
{
$activeModuleDescription = $this->moduleManager->getModuleDescription($this->activeModuleName);
$request = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Request');
/* @var Request $request */
$request->setControllerExtensionName(ucfirst($activeModuleDescription['extensionKey']));
$request->setControllerName($activeModuleDescription['controller'] . 'Module');
$request->setControllerActionName('index');
if (!is_null($this->site)) {
$request->setArgument('site', $this->site);
}
$request->setPluginName($this->request->getPluginName());
if ($this->request->hasArgument('moduleAction')) {
// TODO check whether action is registered/allowed
$request->setControllerActionName($this->request->getArgument('moduleAction'));
}
// transfer additional parameters
foreach ($this->request->getArguments() as $argumentName => $argumentValue) {
if (in_array($argumentName, array('module', 'moduleAction', 'controller'))) {
// these have been transferred already
continue;
}
$request->setArgument($argumentName, $argumentValue);
}
$response = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Mvc\\Web\\Response');
/* @var Response $response */
while (!$request->isDispatched()) {
try {
$this->activeModule->processRequest($request, $response);
} catch (StopActionException $ignoredException) {
}
}
$this->view->assign('moduleContent', $response->getContent());
}
示例2: processRequest
/**
* Handles a request. The result output is returned by altering the given response.
*
* @param RequestInterface $request The request object
* @param ResponseInterface $response The response, modified by this handler
* @return void
* @api
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
if ($request instanceof WidgetRequest) {
$this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
}
parent::processRequest($request, $response);
}
示例3: processRequest
/**
* @param RequestInterface $request
* @param ResponseInterface $response
* @throws \Exception
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
try {
parent::processRequest($request, $response);
} catch (\Exception $exception) {
$this->handleKnownExceptionsElseThrowAgain($exception);
}
}
示例4: processRequest
/**
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
* @throws \RuntimeException
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
try {
parent::processRequest($request, $response);
} catch (\TYPO3\CMS\Extbase\Property\Exception $exception) {
throw new \RuntimeException($this->getRuntimeIdentifier() . ': ' . $exception->getMessage() . ' (' . $exception->getCode() . ')');
}
}
示例5: processRequest
/**
* Processes a general request. The result can be returned by altering the given response.
*
* @param RequestInterface $request The request object
* @param ResponseInterface $response The response, modified by this handler
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->doc = $this->documentTemplate;
parent::processRequest($request, $response);
$pageHeader = $this->documentTemplate->startpage($this->languageService->sL('LLL:EXT:typo3_forum/Resources/Private/Language/locallang_mod.xml:module.title'));
$pageEnd = $this->documentTemplate->endPage();
$response->setContent($pageHeader . $response->getContent() . $pageEnd);
}
示例6: processRequest
/**
* Processes a general request. The result can be returned by altering the given response.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException if the controller doesn't support the current request type
* @return void
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
$this->template = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\\CMS\\Backend\\Template\\DocumentTemplate');
$this->pageRenderer = $this->template->getPageRenderer();
$GLOBALS['SOBE'] = new \stdClass();
$GLOBALS['SOBE']->doc = $this->template;
parent::processRequest($request, $response);
$pageHeader = $this->template->startpage($GLOBALS['LANG']->sL('LLL:EXT:workspaces/Resources/Private/Language/locallang.xlf:module.title'));
$pageEnd = $this->template->endPage();
$response->setContent($pageHeader . $response->getContent() . $pageEnd);
}
示例7: processRequest
/**
* Load and persist module data
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
* @return void
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\StopActionException
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
$this->moduleData = $this->moduleDataStorageService->loadModuleData();
// We "finally" persist the module data.
try {
parent::processRequest($request, $response);
$this->moduleDataStorageService->persistModuleData($this->moduleData);
} catch (\TYPO3\CMS\Extbase\Mvc\Exception\StopActionException $e) {
$this->moduleDataStorageService->persistModuleData($this->moduleData);
throw $e;
}
}
示例8: processRequest
/**
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
* @return void
* @throws \Exception
* @override \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
* @see http://nerdcenter.de/extbase-fehlerbehandlung/
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
try {
parent::processRequest($request, $response);
} catch (PropertyException $exception) {
// If the property mapper did throw a \TYPO3\CMS\Extbase\Property\Exception, because it was unable to find the requested entity, call the page-not-found handler.
$previousException = $exception->getPrevious();
if ($previousException instanceof PropertyTargetNotFoundException || $previousException instanceof PropertyInvalidSourceException) {
$GLOBALS['TSFE']->pageNotFoundAndExit($this->entityNotFoundMessage);
}
throw $exception;
}
}
示例9: processRequest
/**
* Load and persist module data
*
* @param RequestInterface $request
* @param ResponseInterface $response
*
* @throws StopActionException
* @return void
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
/* @var $persistenceManager \TYPO3\CMS\Extbase\Persistence\Generic\PersistenceManager */
$persistenceManager = $this->objectManager->get('TYPO3\\CMS\\Extbase\\Persistence\\Generic\\PersistenceManager');
// We "finally" persist the module data.
try {
parent::processRequest($request, $response);
$persistenceManager->persistAll();
} catch (StopActionException $e) {
$persistenceManager->persistAll();
throw $e;
}
}
示例10: processRequest
/**
* Redirect request from post when forced
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @return void
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
parent::processRequest($request, $response);
if ($request instanceof \TYPO3\CMS\Extbase\Mvc\Web\Request) {
$arguments = $request->getArguments();
if (isset($arguments['forceRedirect']) && (bool) $arguments['forceRedirect'] === true) {
unset($arguments['forceRedirect'], $arguments['controller'], $arguments['action']);
// Remove empty arguments
$arguments = array_filter($arguments);
$this->redirect($request->getControllerActionName(), null, null, $arguments);
}
}
}
示例11: processRequest
/**
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
* @return void
* @throws \Exception
* @override \TYPO3\CMS\Extbase\Mvc\Controller\ActionController
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
try {
parent::processRequest($request, $response);
} catch (\Exception $exception) {
if ($this->isAjax) {
if ($this->response instanceof \TYPO3\CMS\Extbase\Mvc\Web\Response) {
$this->response->setStatus(500);
}
$this->response->appendContent($exception->getMessage());
} else {
throw $exception;
}
}
}
示例12: processRequest
/**
* Adds code to the standard request processor for saving the last action.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response
*
* @throws \TYPO3\CMS\Extbase\Mvc\Exception\UnsupportedRequestTypeException
*/
public function processRequest(RequestInterface $request, ResponseInterface $response)
{
parent::processRequest($request, $response);
// We are here ony if the action did not throw exceptions (==successful and not forwarded). Save the action.
$this->storeLastModuleInformation();
}
示例13: processRequest
/**
* Handles a request. The result output is returned by altering the given response.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @return void
* @api
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
if (method_exists($request, 'getWidgetContext')) {
$this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
}
\TYPO3\CMS\Extbase\Mvc\Controller\ActionController::processRequest($request, $response);
}
示例14: processRequest
/**
* Fires end-of-lifecycle signal if processing backend request.
*
* @see processRequest() in parent
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
parent::processRequest($request, $response);
if (TYPO3_MODE === 'BE') {
// if we are in BE mode, this ist the last line called
$this->lifecycleManager->updateState(Tx_PtExtbase_Lifecycle_Manager::END);
}
}
示例15: processRequest
/**
* Handles a request. The result output is returned by altering the given response.
*
* @param \TYPO3\CMS\Extbase\Mvc\RequestInterface $request The request object
* @param \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response The response, modified by this handler
* @return void
* @api
*/
public function processRequest(\TYPO3\CMS\Extbase\Mvc\RequestInterface $request, \TYPO3\CMS\Extbase\Mvc\ResponseInterface $response)
{
if ($request instanceof WidgetRequest) {
$this->widgetConfiguration = $request->getWidgetContext()->getWidgetConfiguration();
}
ActionController::processRequest($request, $response);
}