cvs: pear /HTML_Page2/examples Page2_Complex.php Page2_NoDoctype.php Page2_Simple.php Page_Complex.php Page_NoDoctype.php Page_Simple.php
| From: | Klaus Guenther | Date: | Mon, 07 Jun 2004 17:40:56 +0000 |
| Subject: | cvs: pear /HTML_Page2/examples Page2_Complex.php Page2_NoDoctype.php Page2_Simple.php Page_Complex.php Page_NoDoctype.php Page_Simple.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-20315@lists.php.net to get a copy of this message | ||
thesaur Mon Jun 7 13:40:56 2004 EDT
Added files:
/pear/HTML_Page2/examples Page2_Complex.php Page2_NoDoctype.php
Page2_Simple.php
Removed files:
/pear/HTML_Page2/examples Page_Complex.php Page_NoDoctype.php
Page_Simple.php
Log:
Correcting example filenames
http://cvs.php.net/co.php/pear/HTML_Page2/examples/Page2_Complex.php?r=1.1&p=1
Index: pear/HTML_Page2/examples/Page2_Complex.php
+++ pear/HTML_Page2/examples/Page2_Complex.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997 - 2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Klaus Guenther <klaus@capitalfocus.org> |
// +----------------------------------------------------------------------+
//
// $Id: Page2_Complex.php,v 1.1 2004/06/07 17:40:56 thesaur Exp $
require_once 'HTML/Page2.php';
require_once 'HTML/Table.php';
// This is an example from HTML_Table
$table = new HTML_Table('width=100%');
$table->setCaption('256 colors table');
$i = $j = 0;
for ($R = 0; $R <= 255; $R += 51) {
for ($G = 0; $G <= 255; $G += 51) {
for($B = 0; $B <= 255; $B += 51) {
$table->setCellAttributes($i, $j,
'style="background-color:#'.strtolower(sprintf('%02X%02X%02X',
$R, $G, $B)).';"');
$j++;
}
}
$i++;
$j = 0;
}
// end of HTML_Table example
// The initializing code can also be in in the form of an HTML
// attr="value" string.
// Possible attributes are:
// - cache ("true" or "false")
// - charset (e.g., "utf-8")
// - doctype (e.g., "XHTML Basic 1.0")
// - language (two letter designator: e.g., "en")
// - lineend ("unix", "win", "mac", custom string)
// - mime (e.g., "application/xhtml+xml")
// - namespace (URI)
// - profile (URI)
// - tab (e.g., " ")
// - disableProlog (bool)
// All the above have defaults, so it is not necessary
// to specify everything. For example, the proper namespace
// is chosen by default.
$page = new HTML_Page2(array (
'lineend' => 'unix',
'doctype' => 'XHTML 1.0 Strict',
'language' => 'en',
'cache' => 'false',
'tab' => ' '
));
// Page title defaults to "New $doctypeString Compliant Page"
$page->setTitle("HTML_Page2 Color Chart example");
$page->setMetaData("author", "Klaus Guenther");
// let's add a Content-Type meta tag
$page->setMetaContentType();
// Objects with toHtml and toString are supported.
$page->addBodyContent($table);
$page->addBodyContent('<p>Copyright 2003 The PHP Group</p>');
// oops, forgot to add the header:
$page->addBodyContent("<h1>Color Chart</h1>", HTML_PAGE2_PREPEND);
// output to browser
$page->display();
// or to a file
//$page->toFile('example.html');
?>
http://cvs.php.net/co.php/pear/HTML_Page2/examples/Page2_NoDoctype.php?r=1.1&p=1
Index: pear/HTML_Page2/examples/Page2_NoDoctype.php
+++ pear/HTML_Page2/examples/Page2_NoDoctype.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997 - 2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Klaus Guenther <klaus@capitalfocus.org> |
// +----------------------------------------------------------------------+
//
// $Id: Page2_NoDoctype.php,v 1.1 2004/06/07 17:40:56 thesaur Exp $
require_once "HTML/Page2.php";
// With no initial settings, the following defaults are set:
// -> lineends = unix (\12)
// -> doctype = XHTML 1.0 Transitional
// (if set to "none", doctype and language are not set)
// -> language = en
// -> cache = false
$page = new HTML_Page2(array('doctype'=>'none','tab'=>'
'));
// "simple" Page title defaults to "New Page"
$page->addBodyContent("<h1>Headline</h1>");
$page->addBodyContent("<p>Some text</p>");
$page->display ();
?>
http://cvs.php.net/co.php/pear/HTML_Page2/examples/Page2_Simple.php?r=1.1&p=1
Index: pear/HTML_Page2/examples/Page2_Simple.php
+++ pear/HTML_Page2/examples/Page2_Simple.php
<?php
/* vim: set expandtab tabstop=4 shiftwidth=4: */
// +----------------------------------------------------------------------+
// | PHP Version 4 |
// +----------------------------------------------------------------------+
// | Copyright (c) 1997 - 2004 The PHP Group |
// +----------------------------------------------------------------------+
// | This source file is subject to version 3.0 of the PHP license, |
// | that is bundled with this package in the file LICENSE, and is |
// | available at through the world-wide-web at |
// | http://www.php.net/license/3_0.txt.
|
// | If you did not receive a copy of the PHP license and are unable to |
// | obtain it through the world-wide-web, please send a note to |
// | license@php.net so we can mail you a copy immediately. |
// +----------------------------------------------------------------------+
// | Author: Klaus Guenther <klaus@capitalfocus.org> |
// +----------------------------------------------------------------------+
//
// $Id: Page2_Simple.php,v 1.1 2004/06/07 17:40:56 thesaur Exp $
require_once 'HTML/Page2.php';
// With no initial settings, the following defaults are set:
// -> lineends = unix (\12)
// -> doctype = XHTML 1.0 Transitional
// (if set to "none", doctype and language are not set)
// -> language = en
// -> cache = false
$page = new HTML_Page2();
// Page title defaults to "New XHTML 1.0 Transitional Compliant Page"
$page->addBodyContent('<h1>Headline</h1>');
$page->addBodyContent('<p>Copyright 2003 The PHP Group</p>');
$page->display();
?>