AdminPageController Class
Controller to manage the page management form. Located in the namespace Canteen\Controllers.
Item Index
Methods
Methods
addData
-
name
-
value
Add a data substitution variable
addElement
-
element
Add a custom form element
Parameters:
-
element
ObjectFormElementThe form element to add
addNotice
-
message
Add a notice to the buffer output
Parameters:
-
message
StringThe message to output
addTemplate
-
template
-
[data=[]
Add the admin page by template, if there is no template use the default prerender() method
Parameters:
-
template
StringThe template name
-
[data=[]
Dictionary optionalThe optional substitution variables
addTitle
-
title
-
[separator=.]
Prepend to the page title
getContents
()
String
private
Get the page contents from the path
Returns:
The string for the page
getData
()
Dictionary
Get the data variables
Returns:
Data variables for substitution
getPage
()
Page
Get the current page object, this is an override before returning the page, we render the navigation
Returns:
The updated page object
getPageOptions
-
[selectId=null]
-
[ignoreId=null]
-
[showProtected=true]
-
initOption
Get the users as options
Parameters:
Returns:
The html options for the select element
ignoreFields
-
fields
Ignore field names
Parameters:
-
fields
String multipleThe field name as separate arguments
onElementAdd
-
event
Modify existing elements beign added
Parameters:
-
event
ObjectControllerEventThe element addd event
onElementAdded
-
event
When an element is added, inject the content
Parameters:
-
event
ObjectControllerEventThe element addded event
onStart
-
event
Do some setup before we start adding anything
Parameters:
-
event
ObjectControllerEventThe start event
onStartElements
-
event
Before any elements are added
Parameters:
-
event
ObjectControllerEventThe start elements event
optionalFields
-
fields
Don't add the required class to these fields
Parameters:
-
fields
String multipleThe field name as separate arguments
parse
-
content
-
substitutions
Convenience method for parsing content
Parameters:
-
content
StringThe string to parse
-
substitutions
DictionaryThe dictionary of tags to replace
Returns:
The parsed string
pre-render
()
private
Pre-render the admin page with the navigation
process
()
The process method contains nothing navigation is created when renderNavigation is called.
Properties
allObjects
Array
protected
The collection of all object, this can be used to eliminate an additional database request for all the pages.
data
Dictionary
protected
Any custom substitutions for the parser
parser
Parser
The parser is responsible for rendering templates
profiler
Profiler
The instance of the profiler for debugging performance
titleName
String
protected
The name of the item field for use in the select form list
Default: 'title'