Implementation des boucles pour:TABLEAU / for:TABLEAU
Sans aucune modification du compilateur, et en ajoutant un connecteur sur les donnees de type array, et la possibilite de definir une connexion par une fonction req_xxx_connect() au lieu d'un fichier config/xxx.php
Les champs utilisables sont #CLE et #VALEUR
Un critere {tableau xxx} permet de passer le tableau a parcourir :
il peut prendre tout tableau dans l'environnement : #ENV,#ENV{xxx},#GET{xxx},#EVAL{$GLOBALS},#EVAL{$GLOBALS['xxx']}
Un jeu de test bien utile pour montrer les fonctionnalites, incluant l'equivalent d'un var_dump sur un tableau a l'aide d'une boucle recursive :
<BOUCLE_test10(pour:TABLEAU){tableau #ENV}>
#CLE=>#VALEUR<br />
</BOUCLE_test10>
<hr />
<BOUCLE_test101(for:TABLEAU){tableau #ENV}>
#CLE=>#VALEUR<br />
</BOUCLE_test101>
<hr />
<BOUCLE_test11(pour:TABLEAU){tableau #EVAL{$GLOBALS['_ENV']}}>
#CLE=>#VALEUR<br />
</BOUCLE_test11>
<hr />
<BOUCLE_test12(pour:TABLEAU){tableau #ENV}{par cle}>
#CLE=>#VALEUR<br />
</BOUCLE_test12>
<hr />
<BOUCLE_test13(pour:TABLEAU){tableau #ENV}{!par cle}>
#CLE=>#VALEUR<br />
</BOUCLE_test13>
<BOUCLE_test14(pour:TABLEAU){tableau #ENV}{par valeur}>
#CLE=>#VALEUR<br />
</BOUCLE_test14>
<BOUCLE_test15(pour:TABLEAU){tableau #ENV}{!par valeur}>
#CLE=>#VALEUR<br />
</BOUCLE_test15>
<hr />
<B_test16>
<p>#PAGINATION</p>
<ul>
<BOUCLE_test16(pour:TABLEAU){tableau #EVAL{$GLOBALS}}{pagination}{par cle}>
<li>#CLE=>#VALEUR</li>
</BOUCLE_test16>
</ul>
</B_test16>
<hr />
<BOUCLE_test20(pour:TABLEAU){tableau #EVAL{$GLOBALS['_ENV']}}{cle=PATH}>
#CLE=>[(#VALEUR|var_export{1})]<br />
</BOUCLE_test20>
<hr />
<BOUCLE_test21(pour:TABLEAU){tableau #EVAL{$GLOBALS['_ENV']}}{cle==PATH}>
#CLE=>[(#VALEUR|var_export{1})]<br />
</BOUCLE_test21>
<hr />
<BOUCLE_test22(pour:TABLEAU){tableau #EVAL{$GLOBALS['_ENV']}}{cle IN (PATH,truc)}>
#CLE=>[(#VALEUR|var_export{1})]<br />
</BOUCLE_test22>
<hr />
<BOUCLE_test24(pour:TABLEAU){tableau #EVAL{$GLOBALS['_ENV']}}{valeur>a}>
#CLE=>[(#VALEUR|var_export{1})]<br />
</BOUCLE_test24>
<hr />
<B_test23>
<ul><li>
<BOUCLE_test23(pour:TABLEAU){tableau #EVAL{$GLOBALS}}>
#CLE=><B_test231><ul>
<BOUCLE_test231(pour:TABLEAU){tableau #VALEUR}><li>#CLE=><BOUCLE_test232(boucle_test231)></BOUCLE_test232></li></BOUCLE_test231>
</ul>
</B_test231>
#VALEUR</li><//B_test231>
</BOUCLE_test23>
</ul>
</B_test23>
<hr />
#SET{test,#ARRAY{1,2,3,4}}
<BOUCLE_test30(pour:TABLEAU){tableau #GET{test}}>
#CLE=>#VALEUR<br />
</BOUCLE_test30>
<hr />
Chargement en cours
Veuillez vous inscrire ou vous se connecter pour commenter