FRED™  3.0
FRED™: Framework for Rapid and Easy Development
View Class Reference
Inheritance diagram for View:
Component Thing Html Json Txt Xml Rss

Public Member Functions

 jsonEncode ($data)
 
 menu ($menu, $type=null)
 Filter menu items on user rights. More...
 
 render ()
 
- 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

 $convert = false
 
 $minifiedPath = null
 
 $numericCheck = false
 Convert numeric strings to numbers. More...
 
 $maxInt = 0x7fffffff
 Higher numbers (integers) will not be converted (from string). More...
 
 $menuCaptionId = 'menu-*'
 String ID for the menu item caption (an asterisk will be replaced with the controller. More...
 
- 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...
 

Protected Member Functions

 init ()
 
 getData ()
 
- Protected Member Functions inherited from Component
 done ()
 
 getSession ()
 
- Protected Member Functions inherited from Thing
 publish ($property, $visibility=self::READABLE)
 Publish a property (or hide it again). More...
 
 alias ($alias, $property, $object=null)
 Define an alias for a property (of another object). 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

 $_title = null
 
 $_controller = null
 
- 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...
 
 $_aliases = []
 Alias properties (key = alias, value = [object,property]). More...
 

Detailed Description

Definition at line 5 of file View.php.

Member Function Documentation

◆ getData()

getData ( )
protected

Definition at line 66 of file View.php.

◆ init()

init ( )
protected

Reimplemented from Component.

Reimplemented in Html.

Definition at line 18 of file View.php.

◆ jsonEncode()

jsonEncode (   $data)

Definition at line 23 of file View.php.

◆ menu()

menu (   $menu,
  $type = null 
)

Filter menu items on user rights.

Parameters
array$menuArray with menu items. Each item is an array with (optional) keys:
  • caption: caption for the menu item (when not provided the global menuCaptionId is used).
  • controller: controller (page) for this item.
  • link: link for this page (overrides reverse controller name route, but can also be used in absence of controller).
  • right: right the user must have to view this page, and thus the menu item (controller default right is also checked).
  • items: array with sub-menu items.
string$typeView type (empty = default; true = current).
Returns
array Nested array with only viewable items, or items with sub-items. Key = caption. value = array with:
  • link: link for the item.
  • items: sub items (always present; might be empty).

Definition at line 42 of file View.php.

◆ render()

render ( )

Reimplemented in Html, Xml, Rss, and Txt.

Definition at line 59 of file View.php.

Field Documentation

◆ $_controller

$_controller = null
protected

Definition at line 16 of file View.php.

◆ $_title

$_title = null
protected

Definition at line 14 of file View.php.

◆ $convert

$convert = false

Definition at line 7 of file View.php.

◆ $maxInt

$maxInt = 0x7fffffff

Higher numbers (integers) will not be converted (from string).

Definition at line 10 of file View.php.

◆ $menuCaptionId

$menuCaptionId = 'menu-*'

String ID for the menu item caption (an asterisk will be replaced with the controller.

Definition at line 11 of file View.php.

◆ $minifiedPath

$minifiedPath = null

Definition at line 8 of file View.php.

◆ $numericCheck

$numericCheck = false

Convert numeric strings to numbers.

Definition at line 9 of file View.php.


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