@adonisjs/view
Version:
View/template engine for AdonisJs
25 lines (24 loc) • 849 B
JavaScript
;
/*
* @adonisjs/view
*
* (c) Harminder Virk <virk@adonisjs.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.defineReplBindings = void 0;
/**
* Define repl bindings. The method must be invoked when application environment
* is set to repl.
*/
function defineReplBindings(app, Repl) {
Repl.addMethod('loadView', (repl) => {
repl.server.context.View = app.container.use('Adonis/Core/View');
repl.notify(`Loaded View module. You can access it using the "${repl.colors.underline('View')}" variable`);
}, {
description: 'Load view provider and save reference to the "View" variable',
});
}
exports.defineReplBindings = defineReplBindings;