\NLBindingDefinition
An object that defines a binding. Cases include: - a method in the context.
- a dereferenced object in the context, as the templating engine does.
- a constant value that is embedded in the component itself (an represented in the binding defintion.
- a value that changes dynamically in the browser, in response to an event. A DataChange event might be thrown
by a component in javascript, and this property binding will automatically listen, and an ajax request
automatically fired to refresh the component's display based on the new binding.
Instances represent how a value is to be retrieve, and can also retrieve the value given a context.
Synopsis
class NLBindingDefinition
{
- // constants
- const BIND_EMBEDDED = "embedded";
- const BIND_CONTEXT = "context";
- const BIND_EVENT = "event";
- const BIND_NONE = "none";
- // members
- protected $type $type;
- // methods
- public void __construct()
- public DBField getValue()
- public void getBaseType()
- public void getFromContext()
Tasks
Line | Task |
---|---|
377+ | Another binding mode to consider: bind to same thing as specified property on another component in the view. |
490+ | Detect types - how to handle type mismatches Context reference can be of the form: - { scope "." }* ident ["(" expr { "," expr}")"] - expr: number | string-literal | jquery-selector |
Constants
Name | Value |
---|---|
BIND_EMBEDDED | "embedded" |
BIND_CONTEXT | "context" |
BIND_EVENT | "event" |
BIND_NONE | "none" |
Members
protected
- $type
—
$type
Type of binding. Values: - "embedded" - the property is bound to a value embedded in the component, stored in $value.
Methods
public
- __construct() — Constructor takes an optional raw PHP object (e.g. stdClass) and interprets the properties to build the binding definition object. If $raw is null, we build a binding that represents "unbound".
- getBaseType()
- getFromContext() — Get from context. $this->value to contain the expression? This value is built by the editor.
- getValue() — Return the value associated with a binding.