A decorator for a binding function that allows it to be called as bind() rather than apply().
Bind any input value to the empty NodeSeq.
Wrap the specified Binding (a function from NodeSeq => NodeSeq) in a Binder so that it can be applied using Binder's bind methods.
Implicitly convert the specified object to a binder for that object if a DataBinding for that object's type is available in implicit scope.
Implicitly convert the specified object to a binder for that object if a DataBinding for that object's type is available in implicit scope. This essentially adds a bind() method to an object if an appropriate implicit DataBinding is available.
A collection of types and implicit transformations used to allow composition of page elements based upon the types of rendered objects.
In Lift, a "snippet" is a function from NodeSeq => NodeSeq, where the argument to the function is a template, and the result is a fragment of a page to be rendered. Of course, this is a bit of an abbreviation; the snippet function also has an argument which is the application state made available from S. A DataBinding[T] is very similar in this respect; it is a function from some piece of information of type T to a function from NodeSeq => NodeSeq. Since DataBinding is strongly typed with respect to the type of information being rendered, DataBinding instances are ideal for the rendering of objects that is used to build up snippets. For example:
In this example, two classes and their associated bindings are constructed; the first binding for MyClass is abstract, needing a specific instance of DataBinding[MyOtherClass] to enable the implicit conversion needed to render the contained MyOtherClass instance. A subtemplate is selected, and the call to other.bind both necessitates the implicit conversion to a Bindings.Binder instance and applies the appropriate formatting. You can see how this usage keeps the concerns of the view and the model nicely separated, while allowing composition over object graphs.
Please see the tests, as well as this blog post for additional details.