Your browser must have JavaScript enabled in order to view this page.
 
Welcome Guest#3507 Login/register    Go to Bottom
Go to Top
 > DpNpc   DpUniverse >
DpPage

DpPage

CREATING DUTCHPIPE PAGES

 > Building a page
 > DpObject

Building a page

You can build a page in two ways:

  1. Make a new instance of DpPage and call methods in it to set it up. This is especially useful for automated page generation, such as pages generated from a CMS. For example:

    1. inherit(DPUNIVERSE_STD_PATH 'DpPage.php');
    2.  
    3. $mypage get_current_dpuniverse()->newDpObject(DPUNIVERSE_STD_PATH
    4.     . 'DpPage.php');
    5. $mypage->setTitle('Test page');
    6. $mypage->setBody('Hello world');
    7. $mypage->location '/page/test';
  2. By making a custom class that extends on DpPage. This is currently the default method of building pages.

    dpuniverse/page/testpage.php

    1. inherit(DPUNIVERSE_STD_PATH 'DpPage.php');
    2.  
    3. final class Testpage extends DpPage
    4. {
    5.     public function createDpPage()
    6.     {
    7.         $this->setTitle('Test page');
    8.         $this->setBody('Hello world');
    9.     }
    10. }

The class name should be the same as the filename, with the first letter capitalized.

Note that because of PHP namespace limitations, currently the classname must be unique in your universe. We plan on supporting auto-class names.

There are various methods you can call (like setTitle) or define (like createDpPage) which will be discussed next.

DpObject

DpPage extends on the DpObject class which implements common object functionality, so all definable methods and callable methods made available by DpObject are also available when creating a page.

If you haven't done so, you should first read the DpObject documentation.


 > DpNpc   DpUniverse >

Documentation generated on Mon, 03 Sep 2007 22:17:46 +0200 by phpDocumentor 1.3.0RC6

Click me!
Guest#3507
 
 
 
  Go to Top
 
 
Input Field OptionsClose Input Field Go to Top
 
Legal Notices | Copyright © 2006, 2007 Lennert Stock. All rights reserved. Last update: Mon Sep 03 2007, 21:50 CET.