Quick search:

11. Custom layout

This application is situated in the example11 folder. To run it on your own server you need the same data as for example3. To try it out on the phpPeanuts website click here.

It extends a copy from example 4 with a custom layout of the default user interface. Example 4 does not contain any user interface customization except for the user interface meta data. Therefore this example is a good starting point for creating your own default user interface layout, that can be reused by all your future phpPeanuts applications. Also see how to create your own default user interface layout.

Instead of copying the domain model classes from the example4 classFolder, the example4 classFolder was used directly for the domain model classes. Therefore the example11 classFolder only contains versions of the default user interface classes for overriding the default user interface layout. Setting the domain model class folder to be example4 instead of example11 was done in index.php by:
$site->setDomainDir('example4');

In order to override the default user interface layout, we copied many of the skins from the includes folder to the example11 folder. We also created a custom style sheet: example11/media/example11.css. example11/skinHeader.php was made to include example11.css instead of ../style/phppeanuts.css.

We have also overridden several part classes by copying them to the example11 classFolder. Most of them only contain some initial values for fields, except for ButtonsPart, which contains code that produces a very different button layout.