Users guide:Page Inheritance

Abstract: In VCL for PHP you can inherit from a page to inherit its components and events, so you can create a master page and inherit all its functionality.

This is specially useful when you create websites, where usually there is a common look and feel for all the website and there is a content zone, which is the one that changes.

To create a Master Page, that is going to be used as the base class for your form, you just need to:

    Specify a page is the Master Page

To do this, set the IsMaster property to true on the Page you want to become the master one. With this property set, running that Page won't show anything, because that script is not meant to be execute directly.

    Include the Master Page unit in your script

You need to add the unit where your master page resides to the unit you want to use it, this can be done using require_once at the top:

require_once("your_master_page_unit.php");

    Inherit from it

And now, you have to manually change the ancestor for the Page you want to inherit from it, usually is Page and you can change it to YourMasterPageClass. Now, if you run your page, it will show the contents of the master page and you can add your own components in design-time.