silverorange / site

Website framework.
GNU Lesser General Public License v2.1
3 stars 18 forks source link

Site

Site is a Website framework built on top of Swat. Site provides several features in one monolothic package:

SiteApplication

This represents an application. There are two main child classes:

SiteApplicationModule

Reusable features of applications (web or CLI) that should be available wherever there is application context are provided using a module interface.

Example provided modules are:

Modules declare their dependencies and are initialized using a tree sorting algorithm. For example, the messages module depends on the session module.

SitePage and SitePageDecorator

Pages represent route endpoints (URLs) in a web application. The URL path is often referred to as $source. Each page has several lifecycle hooks that can be overridden:

Decorators are composable objects that implement the page interface. They can enable horizontal reuse of features.

SiteLayout

In a web application, each page has an associated layout. The page and layout are created and configured in SiteWebApplication::getPage(). One or more SitePageFactory objects may be used to select the correct page object and layout for a request.

The page sets properties on the layout's $data object. These properties can be used directly inside layout templates. Templates use pure immediate-mode PHP.

Like pages, layouts have request lifecycle hooks. These hooks run before the page hooks of the same name:

Additional Documentation

Installation

Make sure the silverorange composer repository is added to the composer.json for the project and then run:

composer require silverorange/site