awdry

0.2.0 • Public • Published

Awdry

Automatically find views to render from a controller action. Built on Sodor

npm install awdry

Usage

Given a templater quite like Brio that takes a dotted path to a template and a hash of template variables, attaches a render method to controller action with an appropriate path.

var extend = require('estira').extend;
var Controller = require('awdry');
var brio = require('brio');

var templates = brio((t) => (d) => t, {
	account: {
		index: 'hello world'
	}
});

var Account = extend.call(Controller, 'Account', {
	index: function() {
		return this.render();
	}
});

Account.handle('index', [])({}); //⇒ 'hello world'

Licence

MIT. © 2014 Matt Brennan.

Package Sidebar

Install

npm i awdry

Weekly Downloads

1

Version

0.2.0

License

MIT

Last publish

Collaborators

  • quarterto