<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-action-abstract.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'en',
  ),
  'this' => 
  array (
    0 => 'yaf-action-abstract.execute.php',
    1 => 'Yaf_Action_Abstract::execute',
    2 => 'Action entry point',
  ),
  'up' => 
  array (
    0 => 'class.yaf-action-abstract.php',
    1 => 'Yaf_Action_Abstract',
  ),
  'prev' => 
  array (
    0 => 'class.yaf-action-abstract.php',
    1 => 'Yaf_Action_Abstract',
  ),
  'next' => 
  array (
    0 => 'yaf-action-abstract.getcontroller.php',
    1 => 'Yaf_Action_Abstract::getController',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'en',
    'path' => 'reference/yaf/yaf_action_abstract/execute.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-action-abstract.execute" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Action_Abstract::execute</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Action_Abstract::execute</span> &mdash; <span class="dc-title">Action entry point</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-action-abstract.execute-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">abstract</span> <span class="modifier">public</span><span class="methodname"><strong>Yaf_Action_Abstract::execute</strong></span>(<span class="methodparam"><span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span> <code class="parameter">...$args</code></span>): <span class="type"><a href="language.types.mixed.php" class="type mixed">mixed</a></span></div>

  <p class="para rdfs-comment">
   user should always define this method for a action, this is the entry point
   of an action.
   <span class="methodname"><strong>Yaf_Action_Abstract::execute()</strong></span> may have agruments.
   <blockquote class="note"><p><strong class="note">Note</strong>: 
    <p class="para">
     The value retrived from the request is not safe. you should do some
     filtering work before you use it.
    </p>
   </p></blockquote>
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-action-abstract.execute-parameters">
  <h3 class="title">Parameters</h3>
  <dl>
   
    <dt><code class="parameter">args</code></dt>
    <dd>
     <p class="para">

     </p>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-action-abstract.execute-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">

  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-action-abstract.execute-examples">
  <h3 class="title">Examples</h3>
  <div class="example" id="example-1">
   <p><strong>Example #1 <span class="function"><strong>Yaf_Action_Abstract::execute()</strong></span>example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/** <br /> * A controller example<br /> */<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">ProductController </span><span style="color: #007700">extends </span><span style="color: #0000BB">Yaf_Controller_Abstract </span><span style="color: #007700">{<br />      protected </span><span style="color: #0000BB">$actions </span><span style="color: #007700">= array(<br />          </span><span style="color: #DD0000">"index" </span><span style="color: #007700">=&gt; </span><span style="color: #DD0000">"actions/Index.php"</span><span style="color: #007700">,<br />      );<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></div>
   </div>

  </div>
  <div class="example" id="example-2">
   <p><strong>Example #2 <span class="function"><strong>Yaf_Action_Abstract::execute()</strong></span>example</strong></p>
   <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000"><span style="color: #0000BB">&lt;?php<br /></span><span style="color: #FF8000">/** <br /> * ListAction<br /> */<br /></span><span style="color: #007700">class </span><span style="color: #0000BB">ListAction </span><span style="color: #007700">extends </span><span style="color: #0000BB">Yaf_Action_Abstract </span><span style="color: #007700">{<br />     public function </span><span style="color: #0000BB">execute </span><span style="color: #007700">(</span><span style="color: #0000BB">$name</span><span style="color: #007700">, </span><span style="color: #0000BB">$id</span><span style="color: #007700">) {<br />         </span><span style="color: #0000BB">assert</span><span style="color: #007700">(</span><span style="color: #0000BB">$name </span><span style="color: #007700">== </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getRequest</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getParam</span><span style="color: #007700">(</span><span style="color: #DD0000">"name"</span><span style="color: #007700">));<br />         </span><span style="color: #0000BB">assert</span><span style="color: #007700">(</span><span style="color: #0000BB">$id   </span><span style="color: #007700">== </span><span style="color: #0000BB">$this</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getRequest</span><span style="color: #007700">()-&gt;</span><span style="color: #0000BB">getParam</span><span style="color: #007700">(</span><span style="color: #DD0000">"id"</span><span style="color: #007700">));<br />     }<br />}<br /></span><span style="color: #0000BB">?&gt;</span></span></code></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">/**
 * Now assuming we are using the Yaf_Route_Static route 
 * for request: http://yourdomain/product/list/name/yaf/id/22
 * will result:
 */
 bool(true)
 bool(true)</pre>
</div>
   </div>
  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-action-abstract.execute-seealso">
  <h3 class="title">See Also</h3>
  <ul class="simplelist">
   <li>
  </ul>
 </div>


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