UserFrosting
UserFrosting Main Class.
Table of Contents
$ci | Container | |
---|---|---|
$app | App | |
__construct() | Create the UserFrosting application instance. | mixed |
fireEvent() | Fires an event with optional parameters. | Event |
getApp() | Return the underlying Slim App instance, if available. | App |
getContainer() | Return the DI container. | Container |
run() | Initialize the application. Set up Sprinkles and the Slim app, define routes, register global middleware, and run Slim. | mixed |
setupSprinkles() | Register system services, load all sprinkles, and add their resources and services. | mixed |
setupApp() | Setup UserFrosting App, load sprinkles, load routes, etc. | mixed |
renderSprinkleErrorPage() | Render a basic error page for problems with loading Sprinkles. | mixed |
renderSprinkleErrorCli() | Render a CLI error message for problems with loading Sprinkles. | mixed |
Properties
$ci
protected
Container
$ci
$app
protected
App
$app
Methods
__construct()
Create the UserFrosting application instance.
public
__construct(
[ $cli :
bool
= false ]
)
: mixed
Parameters
- $cli : bool = false
Is the app in CLI mode. Set to false if setting up in an HTTP/web environment, true if setting up for CLI scripts.
Return values
mixedfireEvent()
Fires an event with optional parameters.
public
fireEvent(
$eventName :
string
[, $event :
Event|null
= null ]
)
: Event
Parameters
- $eventName : string
- $event : Event|null = null
Return values
EventgetApp()
Return the underlying Slim App instance, if available.
public
getApp(
)
: App
Return values
AppgetContainer()
Return the DI container.
public
getContainer(
)
: Container
Return values
Containerrun()
Initialize the application. Set up Sprinkles and the Slim app, define routes, register global middleware, and run Slim.
public
run(
)
: mixed
Return values
mixedsetupSprinkles()
Register system services, load all sprinkles, and add their resources and services.
protected
setupSprinkles(
)
: mixed
Return values
mixedsetupApp()
Setup UserFrosting App, load sprinkles, load routes, etc.
protected
setupApp(
)
: mixed
Return values
mixedrenderSprinkleErrorPage()
Render a basic error page for problems with loading Sprinkles.
protected
renderSprinkleErrorPage(
[ $errorMessage :
string
= '' ]
)
: mixed
Parameters
- $errorMessage : string = ''
Message to display [Default ""]
Return values
mixedrenderSprinkleErrorCli()
Render a CLI error message for problems with loading Sprinkles.
protected
renderSprinkleErrorCli(
[ $errorMessage :
string
= '' ]
)
: mixed
Parameters
- $errorMessage : string = ''
Message to display [Default ""]