[Beeframework-svn] SF.net SVN: beeframework:[266] trunk/framework/Bee/MVC/View
Brought to you by:
b_hartmann,
m_plomer
From: <m_p...@us...> - 2014-10-27 22:33:56
|
Revision: 266 http://sourceforge.net/p/beeframework/code/266 Author: m_plomer Date: 2014-10-27 22:33:34 +0000 (Mon, 27 Oct 2014) Log Message: ----------- - extracted ViewBase from AbstractView Modified Paths: -------------- trunk/framework/Bee/MVC/View/AbstractView.php trunk/framework/Bee/MVC/View/RedirectView.php Added Paths: ----------- trunk/framework/Bee/MVC/View/ViewBase.php Modified: trunk/framework/Bee/MVC/View/AbstractView.php =================================================================== --- trunk/framework/Bee/MVC/View/AbstractView.php 2014-10-18 07:56:39 UTC (rev 265) +++ trunk/framework/Bee/MVC/View/AbstractView.php 2014-10-27 22:33:34 UTC (rev 266) @@ -24,31 +24,12 @@ * @author Benjamin Hartmann * @author Michael Plomer <mic...@it...> */ -abstract class AbstractView implements IView { +abstract class AbstractView extends ViewBase { private $statusCode = 200; private $contentType; - private $staticAttributes = array(); - - /** - * @Return void - * @Param name String - * @Param object Object - */ - public final function addStaticAttribute($name, $object) { - $this->staticAttributes[$name] = $object; - } - - public function setStaticAttributes(array $staticAttributes) { - $this->staticAttributes = array_merge($this->staticAttributes, $staticAttributes); - } - - public function getStaticAttributes() { - return $this->staticAttributes; - } - public function getStatusCode() { return $this->statusCode; } Modified: trunk/framework/Bee/MVC/View/RedirectView.php =================================================================== --- trunk/framework/Bee/MVC/View/RedirectView.php 2014-10-18 07:56:39 UTC (rev 265) +++ trunk/framework/Bee/MVC/View/RedirectView.php 2014-10-27 22:33:34 UTC (rev 266) @@ -23,7 +23,7 @@ * Class RedirectView * @package Bee\MVC\View */ -class RedirectView implements IView, IHttpStatusCodes { +class RedirectView extends ViewBase { const MODEL_KEY_REDIRECT_URL = 'redirectUrl'; const MODEL_KEY_GET_PARAMS = 'getParams'; Added: trunk/framework/Bee/MVC/View/ViewBase.php =================================================================== --- trunk/framework/Bee/MVC/View/ViewBase.php (rev 0) +++ trunk/framework/Bee/MVC/View/ViewBase.php 2014-10-27 22:33:34 UTC (rev 266) @@ -0,0 +1,34 @@ +<?php +namespace Bee\MVC\View; + +use Bee\MVC\IHttpStatusCodes; +use Bee\MVC\IView; + +/** + * Class ViewBase + * @package Bee\MVC\View + */ +abstract class ViewBase implements IView, IHttpStatusCodes { + + /** + * @var array + */ + private $staticAttributes = array(); + + /** + * @Return void + * @Param name String + * @Param object Object + */ + public final function addStaticAttribute($name, $object) { + $this->staticAttributes[$name] = $object; + } + + public function setStaticAttributes(array $staticAttributes) { + $this->staticAttributes = array_merge($this->staticAttributes, $staticAttributes); + } + + public function getStaticAttributes() { + return $this->staticAttributes; + } +} \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |