[SPIP] ~v3.0.20-->v3.0.25
[lhc/web/clavette_www.git] / www / ecrire / iterateur / php.php
1 <?php
2
3
4 /***************************************************************************\
5 * SPIP, Systeme de publication pour l'internet *
6 * *
7 * Copyright (c) 2001-2016 *
8 * Arnaud Martin, Antoine Pitrou, Philippe Riviere, Emmanuel Saint-James *
9 * *
10 * Ce programme est un logiciel libre distribue sous licence GNU/GPL. *
11 * Pour plus de details voir le fichier COPYING.txt ou l'aide en ligne. *
12 \***************************************************************************/
13
14 if (!defined('_ECRIRE_INC_VERSION')) return;
15
16 //
17 // creer une boucle sur un iterateur
18 // annonce au compilo les "champs" disponibles
19 //
20 function iterateur_php_dist($b, $iteratorName) {
21 $b->iterateur = $iteratorName; # designe la classe d'iterateur
22 $b->show = array(
23 'field' => array(
24 'cle' => 'STRING',
25 'valeur' => 'STRING',
26 )
27 );
28 foreach (get_class_methods($iteratorName) as $method) {
29 $b->show['field'][ strtolower($method) ] = 'METHOD';
30 }
31 /*
32 foreach (get_class_vars($iteratorName) as $property) {
33 $b->show['field'][ strtolower($property) ] = 'PROPERTY';
34 }
35 */
36 return $b;
37 }
38
39
40 ?>