AdminObjectController Class
Admin controller for standard object editing Located in the namespace Canteen\Controllers.
Constructor
AdminObjectController
-
item
-
formName
-
[titleName='title']
Parameters:
-
item
ObjectServiceItemThe item render with controller
-
formName
StringThe full class name of the form
-
[titleName='title']
String optionalThe name of the object field to use as select title
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
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
ignoreFields
-
fields
Ignore field names
Parameters:
-
fields
String multipleThe field name as separate arguments
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'