[ Index ]
 

Code source de XOOPS 2.0.17.1

Accédez au Source d'autres logiciels libres

title

Body

[fermer]

/htdocs/class/smarty/xoops_plugins/ -> compiler.foreachq.php (sommaire)

foreachq Smarty compiler plug-in See the enclosed file LICENSE for licensing information. If you did not receive this file, get it at http://www.fsf.org/copyleft/gpl.html

Author: Skalpa Keo <skalpa@xoops.org>
Copyright: The XOOPS project http://www.xoops.org/
License: http://www.fsf.org/copyleft/gpl.html GNU public license
Version: $Id: compiler.foreachq.php 506 2006-05-26 23:10:37Z skalpa $
Poids: 104 lignes (4 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 fonction

  smarty_compiler_foreachq()

Fonctions
Fonctions qui ne font pas partie d'une Classe:

smarty_compiler_foreachq( $argStr, &$comp )   X-Ref
Quick foreach template plug-in

This plug-in works as a direct replacement for the original Smarty
{@link http://smarty.php.net/manual/en/language.function.foreach.php foreach} function.

The difference with <var>foreach</var> is minimal in terms of functionality, but can boost your templates
a lot: foreach duplicates the content of the variable that is iterated, to ensure non-array
variables can be specified freely. This implementation does not do that, but as a consequence
requires that the variable you specify in the <var>from</var> parameter is an array or
(when using PHP5) an object. Check the difference between the code generated by foreach
and foreachq to understand completely.

<b>Note:</b> to use foreachq, only the opening tag has to be replaced. The closing tab still
remains {/foreach}

<code>
// Iterate, slow version
{foreach from=$array item=elt}
{$elt}
{/foreach}
// Iterate, fast version
{foreachq from=$array item=elt}
{$elt}
{/foreach}
</code>



Généré le : Sun Nov 25 11:44:32 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics