FRED™  3.0
FRED™: Framework for Rapid and Easy Development
Front Class Reference

Front controller component. More...

Inheritance diagram for Front:
Component Thing

Public Member Functions

 controllerName ($class_name)
 Name for a controller by class name. More...
 
 controllerClassName ($name)
 Class name for a controller. More...
 
 controller ($name, $redir=true)
 Get controller by name. More...
 
 execute ()
 Execute the request and render the view. More...
 
- Public Member Functions inherited from Component
 __construct ($fred, $config=null)
 
 __destruct ()
 
 clientConfig ()
 Public configuration. More...
 
 config ($key, $default=null)
 Retrieve a config value. More...
 
 ping ()
 Ping function. More...
 
 filemtime ($filename)
 Filemtime with session cache. More...
 
 component ($name)
 Get a component (local or default). More...
 
 components (... $names)
 Get multiple components in an array. More...
 
- Public Member Functions inherited from Thing
 propertyExists ($property)
 Check if a property exists (public or published). More...
 
 constants ($prefix=null)
 Return all constants. More...
 
 get ($key)
 Get one or more properties. More...
 
 set ($key, $value=null)
 Set one or more properties. More...
 
 __get ($key)
 
 __set ($key, $value)
 

Data Fields

const EVENT_RENDER = 'front:render'
 
 $defaultType = 'html'
 
 $controllerNamespaces = []
 Namespace prefix (key) per controller name prefix (value). More...
 
 $validControllerName = null
 Regex for valid controller names (empty = do not check). More...
 
 $defaultControllerName = 'Home'
 
 $unknownControllerName = 'Unknown'
 
 $deniedControllerName = 'Denied'
 
- Data Fields inherited from Component
 $filemtimeTtl = 0
 
- Data Fields inherited from Thing
const HIDDEN = 0
 Property is hidden. More...
 
const READABLE = 1
 Property is readable. More...
 
const WRITEABLE = 2
 Property is writeable. More...
 
const READWRITE = 3
 Property is readable and writeable. More...
 

Additional Inherited Members

- Protected Member Functions inherited from Component
 init ()
 
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 configure ($config)
 Configure the object. More...
 
 _get ($key)
 Default getter if no specific setter is defined, and the property is also not published (readable). More...
 
 _set ($key, $value)
 Default setter if no specific setter is defined, and the property is also not published (writeable). More...
 
- Protected Attributes inherited from Component
 $_fred = null
 
 $_config = null
 
 $_name = null
 
 $_components = []
 Local components (key = component name, value = component). More...
 
 $_session = null
 
- Protected Attributes inherited from Thing
 $_published = []
 Published properties (key = name of property, value = visibility). More...
 

Detailed Description

Front controller component.

Definition at line 8 of file Front.php.

Member Function Documentation

◆ controller()

controller (   $name,
  $redir = true 
)

Get controller by name.

Parameters
string$nameController name.
bool$redirRedirect to the denied or login controller if the user is not authorized to execute the requested controller action. Otherwise return false.
Returns
\Rsi\Fred\Controller|bool

Definition at line 51 of file Front.php.

◆ controllerClassName()

controllerClassName (   $name)

Class name for a controller.

Parameters
string$nameController name.
Returns
string Class name for the controller.

Definition at line 36 of file Front.php.

◆ controllerName()

controllerName (   $class_name)

Name for a controller by class name.

Parameters
string$class_nameClass name for the controller.
Returns
string Controller name.

Definition at line 25 of file Front.php.

◆ execute()

execute ( )

Execute the request and render the view.

An optionally provided action will be executed, which will also complement the request component. Afterwards the view is rendered.

Definition at line 72 of file Front.php.

Field Documentation

◆ $controllerNamespaces

$controllerNamespaces = []

Namespace prefix (key) per controller name prefix (value).

Definition at line 13 of file Front.php.

◆ $defaultControllerName

$defaultControllerName = 'Home'

Definition at line 16 of file Front.php.

◆ $defaultType

$defaultType = 'html'

Definition at line 12 of file Front.php.

◆ $deniedControllerName

$deniedControllerName = 'Denied'

Definition at line 18 of file Front.php.

◆ $unknownControllerName

$unknownControllerName = 'Unknown'

Definition at line 17 of file Front.php.

◆ $validControllerName

$validControllerName = null

Regex for valid controller names (empty = do not check).

Definition at line 14 of file Front.php.

◆ EVENT_RENDER

const EVENT_RENDER = 'front:render'

Definition at line 10 of file Front.php.


The documentation for this class was generated from the following file: