當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Controller\ActionController類代碼示例

本文整理匯總了PHP中TYPO3\CMS\Extbase\Mvc\Controller\ActionController的典型用法代碼示例。如果您正苦於以下問題:PHP ActionController類的具體用法?PHP ActionController怎麽用?PHP ActionController使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了ActionController類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: initializeView

 /**
  * Initializes the view before invoking an action method.
  *
  * Override this method to solve assign variables common for all actions
  * or prepare the view in another way before the action is called.
  *
  * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view The view to be initialized
  * @return void
  * @api
  */
 protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
 {
     $this->contentObject = $this->configurationManager->getContentObject();
     $this->contentObjectData = $this->contentObject->data;
     $this->data['parent'] = $this->contentObjectData;
     $view->assign('data', $this->data);
     if ($this->settings['region']['htmlTag_langKey']) {
         $this->region = \TYPO3\CMS\Core\Utility\GeneralUtility::trimExplode('_', $this->settings['region']['htmlTag_langKey']);
         $this->region = $this->region[1];
     } else {
         $this->region = $this->settings['region']['default'];
     }
     $view->assign('region', $this->region);
     parent::initializeView($view);
     if (count($this->settings['javascript']['load']) > 0) {
         foreach ($this->settings['javascript']['load'] as $key => $value) {
             if ($value['enable']) {
                 $src = $value['src'];
                 if ($key == 'googleMapsApi') {
                     $src .= '&language=' . ($this->settings['region']['htmlTag_langKey'] ? $this->settings['region']['htmlTag_langKey'] : $this->settings['region']['default']);
                 }
                 if ($key == 'googleMapsApi' && '' != $this->settings['general']['google']['apikey']) {
                     $src .= '&key=' . $this->settings['general']['google']['apikey'];
                 }
                 $this->response->addAdditionalHeaderData($this->wrapJavascriptFile($src));
             }
         }
     }
 }
開發者ID:kj187,項目名稱:typo3-store-locator,代碼行數:39,代碼來源:AbstractController.php

示例2: initializeView

 /**
  * Initializes the module view.
  *
  * @param ViewInterface $view The view
  * @return void
  */
 protected function initializeView(ViewInterface $view)
 {
     $extPath = $this->getRelativeExtensionPath() . 'Resources/Public/CSS/';
     // Skip, if view is initialized in non-backend context
     if (!$view instanceof BackendTemplateView) {
         return;
     }
     parent::initializeView($view);
     if ($this->actionMethodName === 'indexAction') {
         $view->getModuleTemplate()->getPageRenderer()->addCssFile($extPath . 'fullcalendar.min.css');
         $view->getModuleTemplate()->getPageRenderer()->addCssFile($extPath . 'scheduler.min.css');
         $view->getModuleTemplate()->getPageRenderer()->addCssFile($extPath . 'index.css');
         $view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Sessions/Contrib/fullcalendar');
         $view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Sessions/Contrib/scheduler');
         $view->getModuleTemplate()->getPageRenderer()->addRequireJsConfiguration(['paths' => ['sightglass' => $this->getRelativeExtensionPath() . 'Resources/Public/JavaScript/Contrib/sightglass'], 'shim' => ['TYPO3/CMS/Sessions/Contrib/scheduler' => ['deps' => ['TYPO3/CMS/Sessions/Contrib/fullcalendar']], 'TYPO3/CMS/Sessions/Contrib/rivets' => ['deps' => ['sightglass']]]]);
     }
     if ($this->actionMethodName === 'manageAction') {
         $view->getModuleTemplate()->getPageRenderer()->addCssFile($extPath . 'manage.css');
         $view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Sessions/Contrib/uri-templates');
     }
     if (!in_array($this->actionMethodName, $this->actionsWithoutMenu)) {
         $this->generateModuleMenu();
         $this->generateModuleButtons();
     }
 }
開發者ID:t3dd,項目名稱:T3DD16.Backend,代碼行數:31,代碼來源:SessionModuleController.php

示例3: callActionMethod

 /**
  * Calls the specified action method and passes the arguments.
  *
  * If the action returns a string, it is appended to the content in the
  * response object. If the action doesn't return anything and a valid
  * view exists, the view is rendered automatically.
  *
  * @return void
  * @api
  */
 protected function callActionMethod()
 {
     parent::callActionMethod();
     if (isset($this->feedFormats[$this->request->getFormat()])) {
         $this->sendHeaderAndFilename($this->feedFormats[$this->request->getFormat()], $this->request->getFormat());
     }
 }
開發者ID:mkalus,項目名稱:calendarize,代碼行數:17,代碼來源:AbstractController.php

示例4: initializeView

 /**
  * Initializes the module view.
  *
  * @param ViewInterface $view The view
  * @return void
  *
  * @throws
  */
 protected function initializeView(ViewInterface $view)
 {
     // Skip, if view is initialized in non-backend context
     if ($view instanceof TemplateView) {
         parent::initializeView($view);
     }
 }
開發者ID:t3dd,項目名稱:T3DD16.Backend,代碼行數:15,代碼來源:ApiModuleController.php

示例5: initializeView

 /**
  * Set up the doc header properly here
  *
  * @param ViewInterface $view
  */
 protected function initializeView(ViewInterface $view)
 {
     /** @var BackendTemplateView $view */
     parent::initializeView($view);
     // Disable Path
     $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:12,代碼來源:ModulesController.php

示例6: initializeView

 /**
  * Initialize the view
  *
  * @param ViewInterface $view The view
  * @return void
  */
 public function initializeView(ViewInterface $view)
 {
     /** @var BackendTemplateView $view */
     parent::initializeView($view);
     $this->registerDocheaderButtons();
     $view->assign('copyright', BackendUtility::TYPO3_copyRightNotice());
 }
開發者ID:hlop,項目名稱:TYPO3.CMS,代碼行數:13,代碼來源:HelpController.php

示例7: initializeActionMethodValidators

 /**
  * Adds the needed validators to the Arguments:
  *
  * - Validators checking the data type from the @param annotation
  * - Custom validators specified with validate annotations.
  * - Model-based validators (validate annotations in the model)
  * - Custom model validator classes
  * - Validators from framework configuration
  *
  * @return void
  */
 protected function initializeActionMethodValidators()
 {
     parent::initializeActionMethodValidators();
     $frameworkConfiguration = $this->configurationManager->getConfiguration(ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     $actionArgumentValidation = !empty($frameworkConfiguration['mvc']['validation'][$this->request->getControllerName()][$this->request->getControllerActionName()]) ? $frameworkConfiguration['mvc']['validation'][$this->request->getControllerName()][$this->request->getControllerActionName()] : array();
     // Dynamically add argument validators
     foreach ($actionArgumentValidation as $argumentName => $validators) {
         try {
             $argumentValidator = $this->arguments->getArgument($argumentName)->getValidator();
         } catch (NoSuchArgumentException $e) {
             continue;
         }
         $validatorConjunction = $this->validatorResolver->createValidator('TYPO3.CMS.Extbase:Conjunction');
         foreach ($validators as $validatorConfiguration) {
             if (isset($validatorConfiguration['type'])) {
                 $validatorType = $validatorConfiguration['type'];
                 $validatorOptions = isset($validatorConfiguration['options']) ? $validatorConfiguration['options'] : array();
                 $validator = $this->validatorResolver->createValidator($validatorType, $validatorOptions);
                 $validatorConjunction->addValidator($validator);
             }
         }
         if (count($validatorConjunction)) {
             $argumentValidator->addValidator($validatorConjunction);
         }
     }
 }
開發者ID:mjankiewicz,項目名稱:hairu,代碼行數:37,代碼來源:ActionController.php

示例8: CacheUtility

 /**
  * ViewController constructor.
  */
 function __construct()
 {
     parent::__construct();
     $this->cacheUtility = new CacheUtility('bwrk_resources_slider');
     $this->pid = $GLOBALS['TSFE']->id;
     $this->cacheIdentifier = $this->getCacheIdentifier();
 }
開發者ID:bergwerk,項目名稱:bwrk_resources_slider,代碼行數:10,代碼來源:ViewController.php

示例9: 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());
 }
開發者ID:kalypso63,項目名稱:ext-solr,代碼行數:38,代碼來源:AdministrationController.php

示例10: initializeView

 /**
  * Set up the doc header properly here
  *
  * @param ViewInterface $view
  */
 protected function initializeView(ViewInterface $view)
 {
     if ($view instanceof BackendTemplateView) {
         /** @var BackendTemplateView $view */
         parent::initializeView($view);
         $view->getModuleTemplate()->getDocHeaderComponent()->setMetaInformation([]);
         $uriBuilder = $this->objectManager->get(UriBuilder::class);
         $uriBuilder->setRequest($this->request);
         $this->view->getModuleTemplate()->getPageRenderer()->loadRequireJsModule('TYPO3/CMS/Documentation/Main');
         $menu = $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->makeMenu();
         $menu->setIdentifier('DocumentationModuleMenu');
         $isListActive = $this->request->getControllerActionName() === 'list' ? true : false;
         $uri = $uriBuilder->reset()->uriFor('list', array(), 'Document');
         $listMenuItem = $menu->makeMenuItem()->setTitle($this->getLanguageService()->sL('LLL:EXT:documentation/Resources/Private/Language/locallang.xlf:showDocumentation'))->setHref($uri)->setActive($isListActive);
         $menu->addMenuItem($listMenuItem);
         if ($this->getBackendUser()->isAdmin()) {
             $isDownloadActive = $this->request->getControllerActionName() === 'download' ? true : false;
             $uri = $uriBuilder->reset()->uriFor('download', array(), 'Document');
             $downloadMenuItem = $menu->makeMenuItem()->setTitle($this->getLanguageService()->sL('LLL:EXT:documentation/Resources/Private/Language/locallang.xlf:downloadDocumentation'))->setHref($uri)->setActive($isDownloadActive);
             $menu->addMenuItem($downloadMenuItem);
         }
         $this->view->getModuleTemplate()->getDocHeaderComponent()->getMenuRegistry()->addMenu($menu);
         $this->view->getModuleTemplate()->setFlashMessageQueue($this->controllerContext->getFlashMessageQueue());
     }
 }
開發者ID:rickymathew,項目名稱:TYPO3.CMS,代碼行數:30,代碼來源:DocumentController.php

示例11: addFlashMessage

 /**
  * @param string $messageBody
  * @param string $messageTitle
  * @param int $severity
  * @param bool $storeInSession
  */
 public function addFlashMessage($messageBody, $messageTitle = '', $severity = AbstractMessage::OK, $storeInSession = true)
 {
     if (null === $this->controllerContext) {
         $this->controllerContext = $this->buildControllerContext();
     }
     parent::addFlashMessage($messageBody, $messageTitle, $severity, $storeInSession);
 }
開發者ID:vertexvaar,項目名稱:election,代碼行數:13,代碼來源:AbstractBeController.php

示例12: mapRequestArgumentsToControllerArguments

 /**
  * Maps arguments delivered by the request object to the local controller arguments.
  *
  * @return void
  */
 protected function mapRequestArgumentsToControllerArguments()
 {
     try {
         parent::mapRequestArgumentsToControllerArguments();
     } catch (\Exception $e) {
         $this->throwStatus(404, null, ucfirst($this->resourceArgumentName) . ' not found.');
     }
 }
開發者ID:ervaude,項目名稱:json_example,代碼行數:13,代碼來源:AbstractApiController.php

示例13: initializeView

 /**
  * Initializes the view before invoking an action method.
  * Override this method to solve assign variables common for all actions
  * or prepare the view in another way before the action is called.
  * 
  * @param \TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view The view to be initialized
  * @return void
  */
 protected function initializeView(\TYPO3\CMS\Extbase\Mvc\View\ViewInterface $view)
 {
     $cObjData = $this->configurationManager->getContentObject()->data;
     $view->assign('newsItem', $cObjData);
     //$view->assign('contentObjectData', $this->configurationManager->getContentObject()->data);
     $view->assign('emConfiguration', EmConfiguration::getSettings());
     parent::initializeView($view);
 }
開發者ID:sharamigo,項目名稱:php_webprojects,代碼行數:16,代碼來源:NewsAbstractController.php

示例14: __construct

 public function __construct()
 {
     parent::__construct();
     $GLOBALS['LANG']->includeLLFile('EXT:viewpage/Resources/Private/Language/locallang.xlf');
     $this->pageRenderer = $GLOBALS['TBE_TEMPLATE']->getPageRenderer();
     $this->pageRenderer->addInlineSettingArray('web_view', array('States' => $GLOBALS['BE_USER']->uc['moduleData']['web_view']['States']));
     $this->pageRenderer->addInlineLanguageLabelFile('EXT:viewpage/Resources/Private/Language/locallang.xlf');
 }
開發者ID:KarlDennisMatthaei1923,項目名稱:PierraaDesign,代碼行數:8,代碼來源:ViewModuleController.php

示例15: initializeAction

 public function initializeAction()
 {
     parent::initializeAction();
     $this->userSession = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Bjr\\BjrLend\\Utility\\UserSession');
     $this->basketRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Bjr\\BjrLend\\Domain\\Repository\\BasketRepository');
     $this->articleRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Bjr\\BjrLend\\Domain\\Repository\\ArticleRepository');
     $this->orderRepository = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('Bjr\\BjrLend\\Domain\\Repository\\OrderRepository');
 }
開發者ID:manfred-ursprung,項目名稱:bjrfreizeit,代碼行數:8,代碼來源:BasketController.php


注:本文中的TYPO3\CMS\Extbase\Mvc\Controller\ActionController類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。