* renamed ControllerInterface and ViewInterface
[Packages/TYPO3.CMS.git] / typo3 / sysext / extbase / Classes / Controller / TX_EXTMVC_Controller_AbstractController.php
1 <?php
2 declare(ENCODING = 'utf-8');
3
4 /* *
5 * This script belongs to the FLOW3 framework. *
6 * *
7 * It is free software; you can redistribute it and/or modify it under *
8 * the terms of the GNU Lesser General Public License as published by the *
9 * Free Software Foundation, either version 3 of the License, or (at your *
10 * option) any later version. *
11 * *
12 * This script is distributed in the hope that it will be useful, but *
13 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN- *
14 * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser *
15 * General Public License for more details. *
16 * *
17 * You should have received a copy of the GNU Lesser General Public *
18 * License along with the script. *
19 * If not, see http://www.gnu.org/licenses/lgpl.html *
20 * *
21 * The TYPO3 project - inspiring people to share! *
22 * */
23
24 require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/TX_EXTMVC_Controller_ControllerInterface.php');
25
26 /**
27 * An abstract base class for Controllers
28 *
29 * @version $Id:$
30 * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
31 */
32 abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_Controller_ControllerInterface {
33
34 /**
35 * @var string Key of the extension this controller belongs to
36 */
37 protected $extensionKey;
38
39 /**
40 * @var F3_FLOW3_Package_Package The extension this controller belongs to
41 */
42 protected $extension;
43
44 /**
45 * Contains the settings of the current extension
46 *
47 * @var array
48 */
49 protected $settings;
50
51 /**
52 * Constructs the controller.
53 *
54 * @param F3_FLOW3_Object_FactoryInterface $objectFactory A reference to the Object Factory
55 * @param F3_FLOW3_Package_ManagerInterface $packageManager A reference to the Package Manager
56 * @author Robert Lemke <robert@typo3.org>
57 */
58 public function __construct() {
59 list(, $this->extensionKey) = explode('_', get_class($this));
60 // $this->extension = $packageManager->getPackage($this->extensionKey);
61 }
62
63 /**
64 * Injects the settings of the extension.
65 *
66 * @param array $settings Settings container of the current extension
67 * @return void
68 * @author Robert Lemke <robert@typo3.org>
69 */
70 public function injectSettings(array $settings) {
71 $this->settings = $settings;
72 }
73
74 /**
75 * Initializes this object after all dependencies have been resolved.
76 *
77 * @return void
78 * @author Robert Lemke <robert@typo3.org>
79 */
80 public function initializeObject() {
81 $this->initializeController();
82 }
83
84 /**
85 * Initializes this controller.
86 *
87 * Override this method for initializing your concrete controller implementation.
88 * Recommended actions for your controller initialization method are setting up the expected
89 * arguments and narrowing down the supported request types if neccessary.
90 *
91 * @return void
92 * @author Robert Lemke <robert@typo3.org>
93 */
94 protected function initializeController() {
95 }
96 }
97
98 ?>