<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-response-abstract.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-response-abstract.construct.php',
    1 => 'Yaf_Response_Abstract::__construct',
    2 => 'Construct a response',
  ),
  'up' => 
  array (
    0 => 'class.yaf-response-abstract.php',
    1 => 'Yaf_Response_Abstract',
  ),
  'prev' => 
  array (
    0 => 'yaf-response-abstract.clearheaders.php',
    1 => 'Yaf_Response_Abstract::clearHeaders',
  ),
  'next' => 
  array (
    0 => 'yaf-response-abstract.getbody.php',
    1 => 'Yaf_Response_Abstract::getBody',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_response_abstract/construct.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-response-abstract.construct" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Response_Abstract::__construct</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Response_Abstract::__construct</span> &mdash; <span class="dc-title">Construct a response</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-response-abstract.construct-description">
  <h3 class="title">Description</h3>
  <div class="constructorsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Response_Abstract::__construct</strong></span>()</div>

  <p class="simpara">
   Construct a response object. The constructor takes no arguments; the
   concrete subclasses like <span class="classname"><a href="class.yaf-response-http.php" class="classname">Yaf_Response_Http</a></span> and
   <span class="classname"><a href="class.yaf-response-cli.php" class="classname">Yaf_Response_Cli</a></span> initialize their own defaults
   (an HTTP response starts with the <code class="literal">200</code> response code,
   for example).
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="simpara">
    Usually a response object does not need to be constructed manually:
    <span class="methodname"><a href="yaf-dispatcher.getresponse.php" class="methodname">Yaf_Dispatcher::getResponse()</a></span> returns the one
    created by the dispatcher.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-response-abstract.construct-parameters">
  <h3 class="title">Parameters</h3>
  <p class="simpara">This function has no parameters.</p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-response-abstract.construct-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="simpara">
   No value is returned.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-response-abstract.construct-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="methodname"><strong>Yaf_Response_Abstract::__construct()</strong></span> example</strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
</span><span style="color: #FF8000">/* usually there is no need to construct a response manually:
 * the dispatcher creates one and hands it out */
</span><span style="color: #0000BB">$response </span><span style="color: #007700">= </span><span style="color: #0000BB">Yaf_Dispatcher</span><span style="color: #007700">::</span><span style="color: #0000BB">getInstance</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getResponse</span><span style="color: #007700">();

</span><span style="color: #FF8000">/* constructing directly is mostly useful in tests */
</span><span style="color: #0000BB">$response </span><span style="color: #007700">= new </span><span style="color: #0000BB">Yaf_Response_Http</span><span style="color: #007700">();
</span><span style="color: #0000BB">$response</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">setBody</span><span style="color: #007700">(</span><span style="color: #DD0000">"Hello World"</span><span style="color: #007700">);

echo </span><span style="color: #0000BB">$response</span><span style="color: #007700">;
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

   <div class="example-contents"><p>The above example will output
something similar to:</p></div>
   <div class="example-contents screen">
<div class="examplescode"><pre class="examplescode">Hello World</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-response-abstract.construct-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li><span class="methodname"><a href="yaf-dispatcher.getresponse.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::getResponse()</a> - Get the response object</span></li>
   <li><span class="methodname"><a href="yaf-response-abstract.response.php" class="methodname" rel="rdfs-seeAlso">Yaf_Response_Abstract::response()</a> - Send the response</span></li>
  </ul>
 </div>


</div><?php manual_footer($setup); ?>