← Back to team overview

anewt-developers team mailing list archive

[Branch ~uws/anewt/anewt.uws] Rev 1723: [page] Improve AnewtPage example code in manual

 

------------------------------------------------------------
revno: 1723
committer: Wouter Bolsterlee <uws@xxxxxxxxx>
branch nick: anewt.uws
timestamp: Sun 2009-08-02 20:08:50 +0200
message:
  [page] Improve AnewtPage example code in manual
modified:
  doc/manual/examples/page-basic-usage.php
  doc/manual/examples/page-blocks.php
  doc/manual/examples/page-default-content.php
  doc/manual/examples/page-simple.php
  doc/manual/examples/page-stylesheet-javascript.php
  doc/manual/examples/page-valid-content.php


--
lp:anewt
https://code.launchpad.net/~uws/anewt/anewt.uws

Your team Anewt developers is subscribed to branch lp:anewt.
To unsubscribe from this branch go to https://code.launchpad.net/~uws/anewt/anewt.uws/+edit-subscription.
=== modified file 'doc/manual/examples/page-basic-usage.php'
--- doc/manual/examples/page-basic-usage.php	2009-03-30 22:02:27 +0000
+++ doc/manual/examples/page-basic-usage.php	2009-08-02 18:08:50 +0000
@@ -1,8 +1,9 @@
 <?php
 
 anewt_include('page');
+
 $p = new AnewtPage();
-$p->set('title', 'Sample page');
+$p->title = 'This is the title of the page';
 $p->flush();
 
 ?>

=== modified file 'doc/manual/examples/page-blocks.php'
--- doc/manual/examples/page-blocks.php	2009-03-30 22:02:27 +0000
+++ doc/manual/examples/page-blocks.php	2009-08-02 18:08:50 +0000
@@ -1,10 +1,11 @@
 <?php
 
 anewt_include('page');
+
 $p = new AnewtPage();
 
-$p->set('blocks', array('header', 'content', 'footer'));
-$p->set('default-block', 'content');
+$p->blocks = array('header', 'content', 'footer');
+$p->default_block = 'content';
 
 /* Add content to specific blocks */
 $p->append_to('header', ax_p('This is the header text.'));

=== modified file 'doc/manual/examples/page-default-content.php'
--- doc/manual/examples/page-default-content.php	2009-03-30 22:02:27 +0000
+++ doc/manual/examples/page-default-content.php	2009-08-02 18:08:50 +0000
@@ -2,10 +2,10 @@
 
 class MyPage extends AnewtPage
 {
-	function MyPage()
+	function __construct()
 	{
-		AnewtPage::AnewtPage();
-		$this->set('blocks', array('header', 'content', 'footer'));
+		AnewtPage::__construct();
+		$this->blocks = array('header', 'content', 'footer');
 	}
 
 	function build_header() {

=== modified file 'doc/manual/examples/page-simple.php'
--- doc/manual/examples/page-simple.php	2009-03-30 22:02:27 +0000
+++ doc/manual/examples/page-simple.php	2009-08-02 18:08:50 +0000
@@ -1,11 +1,10 @@
 <?php
 
 anewt_include('page');
+
 $p = new AnewtPage();
-
 $p->append(ax_h1('Hello, world!'));
 $p->append(ax_p('This is a simple test page.'));
-
 $p->flush();
 
 ?>

=== modified file 'doc/manual/examples/page-stylesheet-javascript.php'
--- doc/manual/examples/page-stylesheet-javascript.php	2009-03-30 22:02:27 +0000
+++ doc/manual/examples/page-stylesheet-javascript.php	2009-08-02 18:08:50 +0000
@@ -2,10 +2,10 @@
 
 class MyPage extends AnewtPage
 {
-	function MyPage()
+	function __construct()
 	{
 		/* Call the parent constructor */
-		AnewtPage::AnewtPage();
+		AnewtPage::__construct();
 
 		/* Add stylesheets */
 		$this->add_stylesheet_href('style.css');
@@ -22,10 +22,10 @@
 		);
 
 		/* Provide a list of blocks */
-		$this->set('blocks', array('header', 'content', 'footer'));
+		$this->blocks = array('header', 'content', 'footer');
 
 		/* Set some default values */
-		$this->set('title', 'This is the default title');
+		$this->title = 'This is the default title';
 	}
 }
 

=== modified file 'doc/manual/examples/page-valid-content.php'
--- doc/manual/examples/page-valid-content.php	2008-04-17 09:32:00 +0000
+++ doc/manual/examples/page-valid-content.php	2009-08-02 18:08:50 +0000
@@ -1,7 +1,9 @@
 <?php
 
+$p = new AnewtPage();
 $p->append(ax_p('This is a paragraph of text.'));
 $p->append(ax_raw('<p>This is some <code>pre-formatted</code> text.</p>'));
 $p->append('This string will be escaped: <, &, and > are no problem!');
+$p->flush();
 
 ?>