DpPage
DpPage
CREATING DUTCHPIPE PAGES
Building a page
DpObject
Building a page
You can build a page in two ways:
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:
. 'DpPage.php');
$mypage->setTitle('Test page');
$mypage->setBody('Hello world');
$mypage->location = '/page/test';
By making a custom class that extends on DpPage.
This is currently the default method of building pages.
dpuniverse/page/testpage.php
final class Testpage extends DpPage
{
public function createDpPage()
{
$this->setTitle('Test page');
$this->setBody('Hello world');
}
}
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.