NAME

MVC::Neaf::View::JS - JSON-base view for Not Even A Framework.

SYNOPSIS

return {
    # your data ...
    -view => 'JS',
    -jsonp => 'my.jsonp.callback', # this is optional
}

Will result in your application returning raw data in JSON/JSONP format instead or rendering a template.

METHODS

new( %options )

%options may include:

  • preserve_dash - don't strip dashed options. Useful for debugging.

NOTE No input checks are made whatsoever, but this MAY change in the future.

render( \%data )

Returns a scalar with JSON-encoded data.