<?php
include_once $_SERVER['DOCUMENT_ROOT'] . '/include/shared-manual.inc';
$TOC = array();
$TOC_DEPRECATED = array();
$PARENTS = array();
include_once dirname(__FILE__) ."/toc/class.yaf-dispatcher.inc";
$setup = array (
  'home' => 
  array (
    0 => 'index.php',
    1 => 'PHP Manual',
  ),
  'head' => 
  array (
    0 => 'UTF-8',
    1 => 'fr',
  ),
  'this' => 
  array (
    0 => 'yaf-dispatcher.autorender.php',
    1 => 'Yaf_Dispatcher::autoRender',
    2 => 'Active ou d&eacute;sactive le rendu automatique',
  ),
  'up' => 
  array (
    0 => 'class.yaf-dispatcher.php',
    1 => 'Yaf_Dispatcher',
  ),
  'prev' => 
  array (
    0 => 'class.yaf-dispatcher.php',
    1 => 'Yaf_Dispatcher',
  ),
  'next' => 
  array (
    0 => 'yaf-dispatcher.catchexception.php',
    1 => 'Yaf_Dispatcher::catchException',
  ),
  'alternatives' => 
  array (
  ),
  'source' => 
  array (
    'lang' => 'fr',
    'path' => 'reference/yaf/yaf_dispatcher/autorender.xml',
  ),
  'history' => 
  array (
  ),
);
$setup["toc"] = $TOC;
$setup["toc_deprecated"] = $TOC_DEPRECATED;
$setup["parents"] = $PARENTS;
manual_setup($setup);

contributors($setup);

?>
<div id="yaf-dispatcher.autorender" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">Yaf_Dispatcher::autoRender</h1>
  <p class="verinfo">(Yaf &gt;=1.0.0)</p><p class="refpurpose"><span class="refname">Yaf_Dispatcher::autoRender</span> &mdash; <span class="dc-title">Active ou désactive le rendu automatique</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-yaf-dispatcher.autorender-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="modifier">function</span> <span class="methodname"><strong>Yaf_Dispatcher::autoRender</strong></span>(<span class="methodparam"><span class="type"><span class="type"><a href="language.types.null.php" class="type null">?</a></span><span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span> <code class="parameter">$flag</code><span class="initializer"> = null</span></span>): <span class="type"><span class="type"><a href="class.yaf-dispatcher.php" class="type Yaf_Dispatcher">Yaf_Dispatcher</a></span>|<span class="type"><a href="language.types.boolean.php" class="type bool">bool</a></span></span></div>

  <p class="simpara">
   <span class="classname"><a href="class.yaf-dispatcher.php" class="classname">Yaf_Dispatcher</a></span> effectue automatiquement le rendu de la vue
   après avoir distribué une requête entrante. Il est possible d&#039;empêcher
   ce rendu en appelant cette méthode avec le paramètre
   <code class="parameter">flag</code> valant <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong>.
  </p>
  <blockquote class="note"><p><strong class="note">Note</strong>: 
   <p class="simpara">
    Il est également possible de simplement retourner <strong><code><a href="reserved.constants.php#constant.false">false</a></code></strong> dans une action pour empêcher
    le rendu automatique de cette seule action.
   </p>
  </p></blockquote>
 </div>


 <div class="refsect1 parameters" id="refsect1-yaf-dispatcher.autorender-parameters">
  <h3 class="title">Liste de paramètres</h3>
  <dl>
   
    <dt><code class="parameter">flag</code></dt>
    <dd>
     <p class="simpara">
      Indique s&#039;il faut activer le rendu automatique.
     </p>
     <blockquote class="note"><p><strong class="note">Note</strong>: 
      <p class="simpara">
       À partir de Yaf 2.2.0, si ce paramètre n&#039;est pas fourni, l&#039;état courant
       est retourné à la place.
      </p>
     </p></blockquote>
    </dd>
   
  </dl>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-yaf-dispatcher.autorender-returnvalues">
  <h3 class="title">Valeurs de retour</h3>
  <p class="simpara">
   Retourne l&#039;objet <span class="classname"><a href="class.yaf-dispatcher.php" class="classname">Yaf_Dispatcher</a></span> lui-même lorsque
   <code class="parameter">flag</code> est fourni, ou un <a href="language.types.boolean.php" class="link">booléen</a> indiquant si
   le rendu automatique est activé lorsqu&#039;il ne l&#039;est pas.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-yaf-dispatcher.autorender-examples">
  <h3 class="title">Exemples</h3>
  <div class="example" id="example-1">
   <p><strong>Exemple #1 Exemple avec <span class="function"><strong>Yaf_Dispatcher::autoRender()</strong></span></strong></p>
   <div class="example-contents">
<div class="phpcode"><pre><code style="color: #000000"><span style="color: #0000BB">&lt;?php
</span><span style="color: #007700">class </span><span style="color: #0000BB">IndexController </span><span style="color: #007700">extends </span><span style="color: #0000BB">Yaf_Controller_Abstract </span><span style="color: #007700">{
     </span><span style="color: #FF8000">/* la méthode init sera appelée dès qu'un contrôleur sera initialisé */
     </span><span style="color: #007700">public function </span><span style="color: #0000BB">init</span><span style="color: #007700">() {
         if (</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">isXmlHttpRequest</span><span style="color: #007700">()) {
             </span><span style="color: #FF8000">//n'appelle pas render pour une requête ajax
             //une chaîne json sera affichée
             </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">autoRender</span><span style="color: #007700">(</span><span style="color: #0000BB">FALSE</span><span style="color: #007700">);
         }
     }
}
</span><span style="color: #0000BB">?&gt;</span></code></pre></div>
   </div>

  </div>
 </div>


 <div class="refsect1 seealso" id="refsect1-yaf-dispatcher.autorender-seealso">
  <h3 class="title">Voir aussi</h3>
  <p class="para">
   <ul class="simplelist">
    <li><span class="methodname"><a href="yaf-dispatcher.flushinstantly.php" class="methodname" rel="rdfs-seeAlso">Yaf_Dispatcher::flushInstantly()</a> - Active/d&eacute;sactive l'envoi instantan&eacute;</span></li>
   </ul>
  </p>
 </div>


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