PHP Classes
elePHPant
Icontem

File: index.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Elyess Zouaghi  >  View HTML  >  index.php  >  Download  
File: index.php
Role: Example script
Content type: text/plain
Description: examples
Class: View HTML
Generate HTML documents programmatically
Author: By
Last change:
Date: 5 years ago
Size: 1,248 bytes
 

Contents

Class file image Download
<?php

   
include ('view.html.php');
   
   
$html = new ViewHtml();
   
   
// Change $demo value to select wich demo to run (1, 2 or 3)
   
$demo = 3; // 1 2 3
   
   
if ($demo == 1) {
       
$output =
               
$html->html(
                               
$html->head(
                                               
$html->title("Demo ViewHtml #1")
                                ) .
$html->body(
                                               
$html->h(
                                                           
1, "Welcome!"
                                               
) . $html->a(
                                                               
"http://zouaghi.net", "my homepage"
                                               
)
                                )
           
                );
       
        echo
$output;
        exit;
       
    }
// end demo 1
   
   
if ($demo == 2) {
       
        echo
$html->html(null,null,false);
        echo
$html->head(null,null,false);
        echo
$html->style(null,null,false);
        echo
"a.mylink {color: #F23F0; text-decoration: none;}";
        echo
$html->end("style");
        echo
$html->title("Demo ViewHtml #2");
        echo
$html->end("head");
        echo
$html->body(null,null,false);
        echo
$html->h(1, "Welcome!");
        echo
$html->a("http://zouaghi.net", "my homepage", array("id"=>"somelink", "class"=>"mylink"));
        echo
$html->end("body");
        echo
$html->end("html");
       
       
    }
// end demo 2
   
   
if ($demo == 3) {
        echo
$html->div(null,array("id"=>"box"),false) . $html->a("http://zouaghi.net", "my homepage") . $html->end("div");
    }
// end demo 3
   
?>