jsbeans

jsbeans  1.0.0

jsbeans > jsbeans > jsbeans.mvc.controller
Search:
 
Filters

static Class jsbeans.mvc.controller

Main responsable for rendering a content.
It provides utility methods to match Model against a corresponding View.
Should be the last call in a custom controller function/method, after creating or fetching a Model.

Properties

cache - static object

A local cache of generic template Functions. See doU.js documentation for a complete reference.

Methods

execute

static void execute ( model , view , callback )
It matches {@param} model against {@param} view and then invokes {@param} callback.
Internally it used view.load and doU.js Javascript Template Engine, version 0.1.2. There's no need to include in your libraries as it has been directly included in source (doU license permits it).
Parameters:
model <Object | JSON> data in Object or JSON format. May be local or remote, via AJAX request.
view <String> the name of used View remotely loaded in data-templatePath custom attribute of view script tag (<script type="text/javascript" src="jsbeans/mvc.js" data-templatePath="views"></script>) or inline into document if inline="true" has been set (<script type="text/javascript" src="jsbeans/mvc.js" inline="true"></script>).
callback <Function> a Function fired after View load and its match against Model. It takes the result of the matching as argument.
Usually callback(html) simply does a document.getElementById('anID').innerHTML = html;
Returns: void


Copyright © 2016 Francesco Mele. All rights reserved.