Valid XHTML    Valid CSS2    

Listing du fichier tdm_demo.php

 

00001     <?php
00002     
include "std.php" ;
00003     
debutPage
("Demo TDM","strict") ;
00004     
debutSection() ;
00005     
00006     function
para
($nbl=1) {
00007     
p
("texte") ;
00008      for (
$idl
=1;$idl<=$nbl;$idl++) {
00009      echo
"Ceci est un texte répétitif (ligne
$idl). " ;
00010      }
# fin pour idl
00011     
finp() ;
00012     }
# fin de fonction para
00013     
00014     
$tableauDesRubriques = array() ;
00015     
$idr
= 0 ;
00016     
$idr
++; $tableauDesRubriques[$idr] = "Chapitre 1" ;
00017     
$idr
++; $tableauDesRubriques[$idr] = "Chapitre 2" ;
00018     
$idr
++; $tableauDesRubriques[$idr] = "Chapitre 3" ;
00019     
00020     
$tdmCRLM
= new tdm($tableauDesRubriques) ;
00021     
00022     
# on ne doit pas écrire
00023     # $tdmCRLM = new tdm( array("non utilisé","Chapitre_1","Chapitre_2","Chapitre_3")) ;
00024     
00025     
$tdmCRLM
->titre() ;
00026     
$tdmCRLM
->menu("oui","oui","nou") ;
00027     
00028     
$tdmCRLM
->afficheRubrique("oui") ; # Chapitre 1
00029     
00030     
para
(30) ;
00031     
para
(25) ;
00032     
00033     
$tdmCRLM
->afficheRubrique("oui") ; # Chapitre 2
00034     
00035     
para
(28) ;
00036     
para
(15) ;
00037     
para
(12) ;
00038     
00039     
$tdmCRLM
->afficheRubrique("oui") ; # Chapitre 3
00040     
00041     
para
(9) ;
00042     
para
(7) ;
00043     
para
(11) ;
00044     
00045     
finSection() ;
00046     
finPage() ;
00047     
?>

Pour ne pas voir les numéros de ligne, ajoutez &nl=non à la suite du nom du fichier.

 

 

retour gH    Retour à la page principale de   (gH)