* added interfaces for view and controller
authorJochen Rau <j.rau@web.de>
Sun, 25 Jan 2009 16:59:45 +0000 (16:59 +0000)
committerJochen Rau <j.rau@web.de>
Sun, 25 Jan 2009 16:59:45 +0000 (16:59 +0000)
typo3/sysext/extbase/Classes/Controller/TX_EXTMVC_Controller_AbstractController.php
typo3/sysext/extbase/Classes/TX_EXTMVC_ControllerInterface.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/TX_EXTMVC_ViewInterface.php [new file with mode: 0644]
typo3/sysext/extbase/Classes/View/TX_EXTMVC_View_AbstractView.php

index 0be73a1..899ecea 100755 (executable)
@@ -21,13 +21,15 @@ declare(ENCODING = 'utf-8');
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
+require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/TX_EXTMVC_ControllerInterface.php');
+
 /**
  * An abstract base class for Controllers
  *
  * @version $Id:$
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  */
-abstract class TX_EXTMVC_Controller_AbstractController {
+abstract class TX_EXTMVC_Controller_AbstractController implements TX_EXTMVC_ControllerInterface {
 
        /**
         * @var string Key of the extension this controller belongs to
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_ControllerInterface.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_ControllerInterface.php
new file mode 100644 (file)
index 0000000..5038a26
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Interface for controllers
+ *
+ * @version $Id:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+interface TX_EXTMVC_ControllerInterface {
+
+       /**
+        * Sets / injects the settings of the package this controller belongs to.
+        *
+        * @param array $settings Settings container of the current package
+        * @return void
+        */
+       public function injectSettings(array $settings);
+       
+       /**
+        * Injects the session of the extension.
+        *
+        * @param array $session Persistence session of the current extension
+        * @return void
+        * @author Jochen Rau <jochen.rau@typoplanet.de>
+        */
+       public function injectSession(TX_EXTMVC_Persistence_Session $session);
+
+}
+?>
\ No newline at end of file
diff --git a/typo3/sysext/extbase/Classes/TX_EXTMVC_ViewInterface.php b/typo3/sysext/extbase/Classes/TX_EXTMVC_ViewInterface.php
new file mode 100644 (file)
index 0000000..6acd61a
--- /dev/null
@@ -0,0 +1,57 @@
+<?php
+declare(ENCODING = 'utf-8');
+
+/*                                                                        *
+ * This script belongs to the FLOW3 framework.                            *
+ *                                                                        *
+ * It is free software; you can redistribute it and/or modify it under    *
+ * the terms of the GNU Lesser General Public License as published by the *
+ * Free Software Foundation, either version 3 of the License, or (at your *
+ * option) any later version.                                             *
+ *                                                                        *
+ * This script is distributed in the hope that it will be useful, but     *
+ * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHAN-    *
+ * TABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser       *
+ * General Public License for more details.                               *
+ *                                                                        *
+ * You should have received a copy of the GNU Lesser General Public       *
+ * License along with the script.                                         *
+ * If not, see http://www.gnu.org/licenses/lgpl.html                      *
+ *                                                                        *
+ * The TYPO3 project - inspiring people to share!                         *
+ *                                                                        */
+
+/**
+ * Interface of a view
+ *
+ * @version $Id:$
+ * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
+ */
+interface TX_EXTMVC_ViewInterface {
+
+       /**
+        * Sets the current request
+        *
+        * @param TX_EXTMVC_Request $request
+        * @return void
+        */
+       public function setRequest(TX_EXTMVC_Request $request);
+
+       /**
+        * Returns an View Helper instance.
+        * View Helpers must implement the interface TX_EXTMVC_View_Helper_HelperInterface
+        *
+        * @param string $viewHelperObjectName the full name of the View Helper object including namespace
+        * @return TX_EXTMVC_View_Helper_HelperInterface The View Helper instance
+        */
+       public function getViewHelper($viewHelperObjectName);
+
+       /**
+        * Renders the view
+        *
+        * @return string The rendered view
+        */
+       public function render();
+}
+
+?>
\ No newline at end of file
index 11a5a4b..4f8ced9 100755 (executable)
@@ -21,13 +21,15 @@ declare(ENCODING = 'utf-8');
  * The TYPO3 project - inspiring people to share!                         *
  *                                                                        */
 
+require_once(t3lib_extMgm::extPath('extmvc') . 'Classes/TX_EXTMVC_ViewInterface.php');
+
 /**
  * An abstract View
  *
  * @version $Id:$
  * @license http://www.gnu.org/licenses/lgpl.html GNU Lesser General Public License, version 3 or later
  */
-abstract class TX_EXTMVC_View_AbstractView {
+abstract class TX_EXTMVC_View_AbstractView implements TX_EXTMVC_ViewInterface {
 
        /**
         * @var TX_EXTMVC_Request
@@ -112,13 +114,6 @@ abstract class TX_EXTMVC_View_AbstractView {
                $this->model[$name] = $value;
        }
 
-       /**
-        * Renders the view
-        *
-        * @return string The rendered view
-        */
-       abstract public function render();
-
 }
 
 ?>