[TASK] Introduce BackendActionController
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Mvc / Controller / BackendActionController.php
1 <?php
2 namespace TYPO3\CMS\Extbase\Mvc\Controller;
3
4 /*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17 use TYPO3\CMS\Backend\Template\ModuleTemplate;
18 use TYPO3\CMS\Core\Imaging\IconFactory;
19
20 /**
21 * For Usage in Backend Modules.
22 *
23 * Renders the DocHeader component before the content
24 * of the module and serves as generic layout provider.
25 */
26 class BackendActionController extends ActionController {
27
28 /**
29 * @var ModuleTemplate
30 */
31 protected $moduleTemplate;
32
33 /**
34 * @var IconFactory
35 */
36 protected $iconFactory;
37
38 /**
39 * @param ModuleTemplate $moduleTemplate
40 */
41 public function injectModuleTemplate(ModuleTemplate $moduleTemplate) {
42 $this->moduleTemplate = $moduleTemplate;
43 }
44
45 /**
46 * @param IconFactory $iconFactory
47 */
48 public function injectIconFactory(IconFactory $iconFactory) {
49 $this->iconFactory = $iconFactory;
50 }
51
52 /**
53 * Appends content to response object.
54 * The actual module content is wrapped
55 * in the module template component.
56 *
57 * @param string $content
58 */
59 protected function appendContent($content) {
60 $this->moduleTemplate->setContent($content);
61 $this->response->appendContent($this->moduleTemplate->renderContent());
62 }
63
64 }