• ActiveWAFL allows you to define your website's Site Structure
  • A Site Structure is a hierarchy of grouped web pages
  • You do not need to create a Site Structure
  • Creating a Site Sturcture provides these benefits:
    • You are able to override the default relationship between the Request Handler (a Controller in Mvc apps) and the Presentation Template (which represents the physical View in an Mvc app)
      • You can modify the default file naming convention, which is that Requst Handlers (or Controllers) are mapped to a Presentation Template of the same name
      • For example, in an Mvc app, you could have several Controllers returning the same View
    • Your application is aware of your web site's structure, enabling certain features that otherwise are not available

Site Areas

A Site Area is a container for a group of Site Pages. The Site Structure is made up of a single Root Site Area that contains any number of child Site Areas or Site Pages.

Site Areas may contain child Site Areas, nested to any depth.

A Web Application has a SiteArea setting in Application.syrp. This setting determines the normal top-level Site Area and determines the navigation context for the running Applcation. You might have other defined SiteAreas that are reserved for different sub-applications or sub-sections of the main web application.

Site Pages

A Site Page represents a single web page in a web application. The \DblEj\SiteStructure\SitePage and \DblEj\Mvc\SitePage classes are the two implementations currently available.

The term "Site Page" refers to the logical Site Page - not to be confused with the physical SitePage implementations.
If you do not define the Site Structure ahead of time in SiteStructure.syrp, then ActiveWAFL will always assume that the Presentation Template has the same base file name as the Request Handler (the Controller in Mvc apps). For example, a Controller named LandingPage.php will always look for a Presentation Template named LandingPage.tpl (and a Presentation Stylesheet named LandingPage.css) unless otherwise specified in the Site Structure.

Notes for users of ActiveWAFL MVC

A View is made up of a View Template (Html file) and a View Stylesheet (Css file) and is represented physically by a DblEj\Mvc\View (or any other implementor of DblEj\Mvc\IView).
Controllers come in pairs, one for the server-side (PHP file) and one for the client-side (Javascript file).

It can be easy to confuse the concepts described above with Routing. Routing occurs prior to the decisions affected by the Site Structure.

Routing decides what the Requestor is looking for based on the Request sent in and routes it to the appropriate Request Handler. A Request Handler can be a Php script or class (a Controller in the case of Mvc). It is then that the Request Handler can use the Site Structure to decide which Presentation Template to render.

ActiveWAFL is designed to facilitate the Separation of Concerns and provide a clean multi-tiered infrastructure that can be utilized individually and autonomously by different memebers of the development team, based on their role. Web designers can work on the Presentation Layer in Html, programmers can implement the Business Logic in Php and Javascript, and Database administrators can build databases that are automatically transformed into updatable Data Models and Functional Models.

Api Call Definition

<Application Root>/Config/Advanced/ApiCalls.syrp defines where Api/Ajax calls are routed to. All Api calls must be explicitly defined.

In ActiveWAFL MVC apps, Api/Ajax calls are not handled by Controllers. The ActiveWAFL MVC router completely ignores Api calls. They are handled instead by API Handlers.
ApiCalls.syrp file with two Api call definitions
  1. DoSomeActionAndGetSomeData
  2.    ApiCall           =  DoSomeActionAndGetSomeData
  3.    HandlerFunction   =  DoSomeActionAndGetSomeData
  4.    HandlerFile       =  ExampleAjaxHandler.php
  5.    HandlerClass      =  \\MyApp\\Api\\ExampleAjaxHandler
  7. DoSomeOtherActionAndGetSomeData
  8.    ApiCall           =  DoSomeOtherActionAndGetSomeData
  9.    HandlerFunction   =  DoSomeOtherActionAndGetSomeData
  10.    HandlerFile       =  ExampleAjaxHandler.php
  11.    HandlerClass      =  \\MyApp\\Api\\ExampleAjaxHandler