App
in package
Spitfire Application Class. This class is the base of every other 'app', an app is a wrapper of controllers (this allows to plug them into other SF sites) that defines a set of rules to avoid collisions with the rest of the apps.
Every app resides inside of a namespace, this externally defined variable defines what calls Spitfire redirects to the app.
Tags
Table of Contents
- $router : Router
- __construct() : mixed
- Instances a new application. The application maps a directory where it's residing with it's name-space and the URL it's serving.
- directory() : string
- Returns the directory this application is watching.
- namespace() : mixed
- Returns the application's class-namespace. This is the namespace in which spitfire will look for controllers, models etc for this application.
- url() : string
- Gets the URL space this application is serving. Please note that it's highly recommended to avoid using nested namespaces since it will often lead to broken applications.
Properties
$router
private
Router
$router
Methods
__construct()
Instances a new application. The application maps a directory where it's residing with it's name-space and the URL it's serving.
public
__construct(Router $router) : mixed
Please note that some features need to be 'baked' for the applications to properly work (like inline-routes and prebuilt assets). It is recommendable that the 'baking' is performed automatically on composer::install or similar.
Parameters
- $router : Router
-
A scoped router for this application to write it's routes to.
Return values
mixed —directory()
Returns the directory this application is watching.
public
abstract directory() : string
Return values
string —The directory the app resides in and where it's controllers, models, etc directories are located
namespace()
Returns the application's class-namespace. This is the namespace in which spitfire will look for controllers, models etc for this application.
public
abstract namespace() : mixed
Return values
mixed —url()
Gets the URL space this application is serving. Please note that it's highly recommended to avoid using nested namespaces since it will often lead to broken applications.
public
url() : string