How to use the twig.__express function in twig

To help you get started, we’ve selected a few twig examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github namics / generator-nitro / packages / project-nitro-twig / app / templating / twig / engine.js View on Github external
Twig.renderWithLayout = function(path, options, fn) {
	const layoutPath = options.settings.views + '/' +  options.layout + '.' + options.settings['view engine'];

	function layoutRendered(error, layout) {
		function bodyRendered(error, body) {
			layout = layout.replace('', body);
			return fn(null, layout);
		}
		return Twig.__express(path, options, bodyRendered);
	}
	return Twig.__express(layoutPath, options, layoutRendered);
};
github namics / generator-nitro / packages / nitro-app / app / templating / twig / engine.js View on Github external
function layoutRendered(error, layout) {
		function bodyRendered(body) {
			layout = layout.replace('', body);
			return fn(null, layout);
		}
		return Twig.__express(path, options, bodyRendered);
	}
	return Twig.__express(layoutPath, options, layoutRendered);
github namics / generator-nitro / packages / nitro-app / app / templating / twig / engine.js View on Github external
Twig.renderWithLayout = (path, options, fn) => {
	const layoutPath = `${options.settings.views}/${options.layout}.${options.settings['view engine']}`;

	function layoutRendered(error, layout) {
		function bodyRendered(body) {
			layout = layout.replace('', body);
			return fn(null, layout);
		}
		return Twig.__express(path, options, bodyRendered);
	}
	return Twig.__express(layoutPath, options, layoutRendered);
};
github namics / generator-nitro / packages / project-nitro-twig / app / templating / twig / engine.js View on Github external
function layoutRendered(error, layout) {
		function bodyRendered(error, body) {
			layout = layout.replace('', body);
			return fn(null, layout);
		}
		return Twig.__express(path, options, bodyRendered);
	}
	return Twig.__express(layoutPath, options, layoutRendered);