TYPO3 API  SVNRelease
ViewInterface.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 2009 Jochen Rau <jochen.rau@typoplanet.de>
00006 *  All rights reserved
00007 *
00008 *  This class is a backport of the corresponding class of FLOW3.
00009 *  All credits go to the v5 team.
00010 *
00011 *  This script is part of the TYPO3 project. The TYPO3 project is
00012 *  free software; you can redistribute it and/or modify
00013 *  it under the terms of the GNU General Public License as published by
00014 *  the Free Software Foundation; either version 2 of the License, or
00015 *  (at your option) any later version.
00016 *
00017 *  The GNU General Public License can be found at
00018 *  http://www.gnu.org/copyleft/gpl.html.
00019 *
00020 *  This script is distributed in the hope that it will be useful,
00021 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023 *  GNU General Public License for more details.
00024 *
00025 *  This copyright notice MUST APPEAR in all copies of the script!
00026 ***************************************************************/
00027 
00028 /**
00029  * Interface of a view
00030  *
00031  * @package Extbase
00032  * @subpackage MVC\View
00033  * @version $ID:$
00034  * @api
00035  */
00036 interface Tx_Extbase_MVC_View_ViewInterface {
00037 
00038     /**
00039      * Sets the current controller context
00040      *
00041      * @param Tx_Extbase_MVC_Controller_ControllerContext $controllerContext
00042      * @return void
00043      */
00044     public function setControllerContext(Tx_Extbase_MVC_Controller_ControllerContext $controllerContext);
00045 
00046     /**
00047      * Add a variable to the view data collection.
00048      * Can be chained, so $this->view->assign(..., ...)->assign(..., ...); is possible
00049      *
00050      * @param string $key Key of variable
00051      * @param object $value Value of object
00052      * @return Tx_Extbase_MVC_View_ViewInterface an instance of $this, to enable chaining
00053      * @api
00054      */
00055     public function assign($key, $value);
00056 
00057     /**
00058      * Add multiple variables to the view data collection
00059      *
00060      * @param array $values array in the format array(key1 => value1, key2 => value2)
00061      * @return Tx_Extbase_MVC_View_ViewInterface an instance of $this, to enable chaining
00062      * @api
00063      */
00064     public function assignMultiple(array $values);
00065 
00066     /**
00067      * Tells if the view implementation can render the view for the given context.
00068      *
00069      * @param Tx_Extbase_MVC_Controller_ControllerContext $controllerContext
00070      * @return boolean TRUE if the view has something useful to display, otherwise FALSE
00071      * @api
00072      */
00073     public function canRender(Tx_Extbase_MVC_Controller_ControllerContext $controllerContext);
00074 
00075     /**
00076      * Renders the view
00077      *
00078      * @return string The rendered view
00079      * @api
00080      */
00081     public function render();
00082 
00083     /**
00084      * Initializes this view.
00085      *
00086      * @return void
00087      * @api
00088      */
00089     public function initializeView();
00090 
00091 }
00092 
00093 ?>