Location: PHPKode > projects > DIY Blog > diy-blog/lib/diy-framework/docs/diy-framework/controller/Response.html
<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class Response</title>
			<link rel="stylesheet" href="../../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			

<h2 class="class-name">Class Response</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
											<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
						
			</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Provides access to HTTP response, such as status, headers etc.</p>
<p class="description"><p>Wraps PHP's functions and global arrays to emulate Java's HttpServletResponse interface. That means it can only be used to represent the &quot;current&quot; response.</p></p>
	<ul class="tags">
				<li><span class="field">author:</span> Martynas Jusevicius &lt;<a href="mailto:hide@address.com">hide@address.com</a>&gt;</li>
				<li><span class="field">link:</span> <a href="http://www.xml.lt">http://www.xml.lt</a></li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_diy-framework---controller---Response.class.php.html">/diy-framework/controller/Response.class.php</a> (line <span class="field">12</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>


	<a name="sec-const-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constant Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
						<span class="disabled">Constants</span> (<a href="#sec-consts">details</a>)
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<div class="const-summary">
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SC_FORBIDDEN" title="details" class="const-name">SC_FORBIDDEN</a> = 					<span class="var-type"> 403</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SC_INTERNAL_SERVER_ERROR" title="details" class="const-name">SC_INTERNAL_SERVER_ERROR</a> = 					<span class="var-type"> 500</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SC_METHOD_NOT_ALLOWED" title="details" class="const-name">SC_METHOD_NOT_ALLOWED</a> = 					<span class="var-type"> 405</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SC_NOT_FOUND" title="details" class="const-name">SC_NOT_FOUND</a> = 					<span class="var-type"> 404</span>

				</div>
								<div class="const-title">
					<img src="../../media/images/Constant.png" alt=" " />
					<a href="#SC_OK" title="details" class="const-name">SC_OK</a> = 					<span class="var-type"> 200</span>

				</div>
							</div>
		</div>
	</div>


	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
															<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
									<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																				<div class="method-definition">
					static 						<span class="method-result"><a href="../../diy-framework/controller/Response.html">Response</a></span>
										<a href="#getInstance" title="details" class="method-name">getInstance</a>
										()
									</div>
																																																																
												<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getBuffer" title="details" class="method-name">getBuffer</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getCharacterEncoding" title="details" class="method-name">getCharacterEncoding</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">string</span>
										<a href="#getContentType" title="details" class="method-name">getContentType</a>
										()
									</div>
																								<div class="method-definition">
											<span class="method-result">int</span>
										<a href="#getStatus" title="details" class="method-name">getStatus</a>
										()
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#sendRedirect" title="details" class="method-name">sendRedirect</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$url</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setCharacterEncoding" title="details" class="method-name">setCharacterEncoding</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setContentType" title="details" class="method-name">setContentType</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$contentType</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setHeader" title="details" class="method-name">setHeader</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#setStatus" title="details" class="method-name">setStatus</a>
											(<span class="var-type">int</span>&nbsp;<span class="var-name">$status</span>)
									</div>
																<div class="method-definition">
											<span class="method-result">void</span>
										<a href="#write" title="details" class="method-name">write</a>
											(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
									</div>
								</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
																		<a href="#sec-const-summary">Constants</a> (<a href="#sec-consts">details</a>)
							
										<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="methodgetInstance" id="getInstance"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">static method getInstance</span> (line <span class="line-number">52</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns instance of self (Response object). Used to implement Singleton pattern.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
	    static
		<span class="method-result"><a href="../../diy-framework/controller/Response.html">Response</a></span>
		<span class="method-name">
			getInstance
		</span>
				()
			</div>
	
		
			
	</div>

<a name="methodgetBuffer" id="getBuffer"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getBuffer</span> (line <span class="line-number">145</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns the whole response output buffer.</p>
	<ul class="tags">
				<li><span class="field">return:</span> Buffer string</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getBuffer
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetCharacterEncoding" id="getCharacterEncoding"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getCharacterEncoding</span> (line <span class="line-number">104</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns character encoding.</p>
	<ul class="tags">
				<li><span class="field">return:</span> Character encoding</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getCharacterEncoding
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetContentType" id="getContentType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">getContentType</span> (line <span class="line-number">83</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns content type.</p>
	<ul class="tags">
				<li><span class="field">return:</span> Content type</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">string</span>
		<span class="method-name">
			getContentType
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgetStatus" id="getStatus"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">getStatus</span> (line <span class="line-number">63</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Returns response status.</p>
	<ul class="tags">
				<li><span class="field">return:</span> Status code</li>
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">int</span>
		<span class="method-name">
			getStatus
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodsendRedirect" id="sendRedirect"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">sendRedirect</span> (line <span class="line-number">124</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sends a temporary redirect response to the client using the specified redirect location URL.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			sendRedirect
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$url</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$url</span><span class="var-description">: Redirect location URL</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetCharacterEncoding" id="setCharacterEncoding"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setCharacterEncoding</span> (line <span class="line-number">114</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets character encoding (e.g. &quot;UTF-8&quot;).</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setCharacterEncoding
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$encoding</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$encoding</span><span class="var-description">: Character encoding</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetContentType" id="setContentType"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setContentType</span> (line <span class="line-number">93</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets content type (e.g. &quot;text/html&quot;).</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setContentType
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$contentType</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$contentType</span><span class="var-description">: Content type</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetHeader" id="setHeader"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">setHeader</span> (line <span class="line-number">41</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets a HTTP response header.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setHeader
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$name</span>, <span class="var-type">string</span>&nbsp;<span class="var-name">$value</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$name</span><span class="var-description">: Name of the header</span>			</li>
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$value</span><span class="var-description">: Value of the header</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetStatus" id="setStatus"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<span class="method-title">setStatus</span> (line <span class="line-number">73</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Sets response status.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setStatus
		</span>
					(<span class="var-type">int</span>&nbsp;<span class="var-name">$status</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$status</span><span class="var-description">: Status code</span>			</li>
				</ul>
		
			
	</div>
<a name="methodwrite" id="write"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<span class="method-title">write</span> (line <span class="line-number">135</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Writes a string into the response output buffer.</p>
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			write
		</span>
					(<span class="var-type">string</span>&nbsp;<span class="var-name">$string</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">string</span>
				<span class="var-name">$string</span><span class="var-description">: String</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	<a name="sec-consts"></a>
	<div class="info-box">
		<div class="info-box-title">Class Constants</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
										<a href="#sec-var-summary">Constants</a> (<span class="disabled">details</span>)
						
			
										| 
									<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
							
					</div>
		<div class="info-box-body">
			<a name="constSC_FORBIDDEN" id="SC_FORBIDDEN"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SC_FORBIDDEN</span>
			 = <span class="const-default"> 403</span>
			(line <span class="line-number">22</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constSC_INTERNAL_SERVER_ERROR" id="SC_INTERNAL_SERVER_ERROR"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SC_INTERNAL_SERVER_ERROR</span>
			 = <span class="const-default"> 500</span>
			(line <span class="line-number">25</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constSC_METHOD_NOT_ALLOWED" id="SC_METHOD_NOT_ALLOWED"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SC_METHOD_NOT_ALLOWED</span>
			 = <span class="const-default"> 405</span>
			(line <span class="line-number">24</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constSC_NOT_FOUND" id="SC_NOT_FOUND"><!-- --></A>
<div class="evenrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SC_NOT_FOUND</span>
			 = <span class="const-default"> 404</span>
			(line <span class="line-number">23</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>
<a name="constSC_OK" id="SC_OK"><!-- --></A>
<div class="oddrow">

	<div class="const-header">
		<img src="../../media/images/Variable.png" />
		<span class="const-title">
			<span class="const-name">SC_OK</span>
			 = <span class="const-default"> 200</span>
			(line <span class="line-number">21</span>)
		</span>
	</div>

	<!-- ========== Info from phpDoc block ========= -->
	
	
</div>

						
		</div>
	</div>

	<p class="notes" id="credit">
		Documentation generated on Tue, 25 Sep 2007 11:17:23 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.3.2</a>
	</p>
	</div></body>
</html>
Return current item: DIY Blog