\Anax\AppAppDIMagic

An App class to wrap the resources of the framework, prepared to use a DI container with magic methods enabled.

Summary

Methods
Properties
Constants
__get()
__call()
setDI()
redirect()
renderPage()
No public properties found
No constants found
No protected methods found
$di
N/A
find()
No private properties found
N/A

Properties

$di

$di : \Anax\DI\Anax\DI\DIInterface

Type

\Anax\DI\Anax\DI\DIInterface — the DI service container.

Methods

__get()

__get(string  $service) : object

Magic method to get and create services.

When created it is also stored as a parameter of this object.

Parameters

string $service

name of class property not existing.

Throws

\Anax\DI\NotFoundException

No entry was found for this identifier.

Returns

object —

as the service requested.

__call()

__call(string  $service, array  $arguments = array()) : \Anax\DI\class

Magic method to get and create services as a method call.

When created it is also stored as a parameter of this object.

Parameters

string $service

name of class property not existing.

array $arguments

Additional arguments to sen to the method (NOT IMPLEMENTED).

Throws

\Anax\DI\NotFoundException

No entry was found for this identifier.

Returns

\Anax\DI\class —

as the service requested.

setDI()

setDI(\Anax\DI\Anax\DI\DIInterface  $di) : self

Set the service container to use

Parameters

\Anax\DI\Anax\DI\DIInterface $di

a service container

Returns

self

redirect()

redirect(  $url) 

Parameters

$url

renderPage()

renderPage(  $data,   $status = 200) 

Render a standard web page using a specific layout.

Parameters

$data
$status

find()

find(string  $service) : object

Find, load service and set as part of the class, then return it.

Parameters

string $service

name of class property not existing.

Throws

\Anax\DI\NotFoundException

No entry was found for this identifier.

Returns

object —

as the service requested.