[ 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.includeq.php (sommaire)

includeq 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.includeq.php 506 2006-05-26 23:10:37Z skalpa $
Poids: 86 lignes (3 kb)
Inclus ou requis:0 fois
Référencé: 0 fois
Nécessite: 0 fichiers

Définit 1 fonction

  smarty_compiler_includeq()

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

smarty_compiler_includeq( $tag_args, &$comp )   X-Ref
Quick include template plug-in

Like {@link smarty_compiler_foreachq() foreachq}, this plug-in has been written to provide
a faster version of an already existing Smarty function. <var>includeq</var> can be used
as a replacement for the Smarty
{@link http://smarty.php.net/manual/en/language.function.include.php include} function as long
as you are aware of the differences between them.

Normally, when you include a template, Smarty does the following:
- Backup all your template variables in an array
- Include the template you specified
- Restore the template variables from the previously created backup array

The advantage of this method is that it makes the main template variables <i>safe</i>: if your
main template uses a variable called <var>$stuff</var> and the included template modifies it
value, the main template will recover the original value automatically.

While this can be useful in some cases (for example, when you include templates you have absolutely
no control over), some may consider this a limitation and it has the disadvantage of slowing down
the inclusion mechanism a lot.

<var>includeq</var> fixes that: the code it generates doesn't contain the variables backup/recovery
mechanism and thus makes templates inclusion faster. Note that however, this new behavior may
create problems in some cases (but you can prevent them most of the times, for example by always
using a <var>tmp_</var> prefix for the variables you create in included templates looping sections).



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