new ContentElement(group, view, parser, renderer)
The ContentElement represents "content" parts of a view; it may itself contain one or more ContentElements.
This class holds the name of the content-field (used via the yield-tag in the layouts: content, header, footer, dialogs, ...)
and its definition as HTML-String.
Name | Type | Description |
---|---|---|
group |
Array | Object |
an array or object with properties name {String}, and content {String} |
view |
Object | the view that owns this ContentElement-element |
parser |
mmir.parser.ParserUtils |
for the the content (optional) if supplied this object must have a function parse({String}) (see templateParseUtil) |
renderer |
mmir.parser.RenderUtils |
for the the content (optional) if supplied, a parser must also be supplied; the renderer must have a function parse({String}) (see templateRenderUtil) |
Methods
-
getController(){mmir.Controller}
-
Gets the controller for this ContentElement.
Returns:
Type Description mmir.Controller the Controller of the owning view -
getDefinition(){String}
-
- Deprecated
- use
getRawText
instead
- use
- See:
Returns:
Type Description String the raw text from which this content element was parsed -
getEnd(){Number}
-
Returns:
Type Description Number the end position for this content Element within #getRawText
-
getName(){String}
-
Gets the name of a
mmir.ContentElement
object (content, header, footer, dialogs, ...).Returns:
Type Description String Name - used by yield tags in layout -
getRawText(){String}
-
- See:
Returns:
Type Description String the raw text from which this content element was parsed -
getStart(){Number}
-
Returns:
Type Description Number the start position for this content Element within #getRawText
-
getView(){mmir.View}
-
Gets the owner for this ContentElement, i.e. the
mmir.View
object.Returns:
Type Description mmir.View the owning View -
hasDynamicContent(){Boolean}
-
Returns:
Type Description Boolean returns true
if this ContentElement conatains dynamic content, i.e. if it needs to be "evaluated" for rendering (otherwise, its plain text representation can be used for rendering) -
stringify(){String}
-
create a String representation for this content element.
Returns:
Type Description String the string-representation -
toHtml(){String}
-
Gets the definition of a
mmir.ContentElement
object. TODO remove this?Returns:
Type Description String The HTML content. -
toStrings(renderingBuffer, data){Array.<String>}
-
Renders this object into the renderingBuffer.
Name Type Description renderingBuffer
Array of Strings (if null
a new buffer will be created)data
Any (optional) the event data with which the rendering was invoked Returns:
Type Description Array.<String> of Strings the renderingBuffer with the contents of this object added at the end