File: full_example.php

Recommend this page to a friend!
  Classes of Bn Gbor  >  HTML X Lite  >  full_example.php  >  Download  
File: full_example.php
Role: Example script
Content type: text/plain
Description: using example for htmlxlite
Class: HTML X Lite
Generate HTML pages programatically
Author: By
Last change:
Date: 7 years ago
Size: 2,304 bytes
 

Contents

Class file image Download
<?
#####################################################################
#
# This is the full example for using htmlxlite
#
# Copyright © Bánó Gábor - 2014
# Email: banogabor72@gmail.com
#
# All rights reserved. No part of this publication may be
# reproduced, stored in a retrieval system, or transmitted
# in any form or by any means without the prior written
# permission of the copyright owner and must contain the
# avove copyright notice.
#
#####################################################################

include "htmlxlite.php";
# prepare to set and display some html headers
html::set_header("charset=utf8","language=en","title=htmlxlite example");
html::set_header("icon=favicon.ico","keywords=html xml htmlxlite php helper");
html::display_header();

# some row to show you how htmlxlite works
html::body();
# inserting remark
html::remark("This code is the result as htmlxlite.php work");
# big header
html::h2("txt=HTMLXLITE");
# subtitle
html::div("txt=This is the example for using htmlxlite.php. You can see the html source code as htmlxlite result, if press ctrl + u key");
# horizontal line
html::hr();
# creating container
html::div("class=container");
# put a return sing to the stack
html::start_block();
# load and display readme.txt file
display_readme();
# close unclosed tags if any (now have)
html::end_block();
# close the container div
html::closetag();
# display copyright
html::div("style=text-align:center;font-size:80%;padding:10em;","txt=Copyright © Bánó Gábor - 2014");
# closes all opened tags
html::finish();
return;

function
display_readme() {
 
html::h4("txt=<h3><u>Readme file:</u></h3>");
 
# read reame.txt file and transforms '<' and '>' characters for displays these in the browser,
  # then highlights the chapters, remark and htmlxlite(.php) text
 
$README = file_get_contents("readme.txt");
 
$README = preg_replace("#\<#","&#60;",$README);
 
$README = preg_replace("#\>#","&#62;",$README);
 
$README = preg_replace("#CHAPTER.+#","<h3><u>$0</u></h3>",$README);
 
$README = preg_replace("#Remark:#","<i><b><u>$0</u></b></i>",$README);
 
$README = preg_replace("#htmlxlite(\.php)*#",'<font color="#f00"><u>$0</u></font>',$README);
 
html::pre();
  echo
$README;
 
# we here 'forget' to close <pre> tag to show how end_block function works
}
?>

For more information send a message to info at phpclasses dot org.