we-class-theme

0.0.4 • Public • Published

we-class-theme

We.js class theme used to load one we.js theme from npm module

API

After all ... load the class

// load the class in your scripts
var Theme = require('we-class-theme');

Load one theme

// load the class in your scripts
var projectFolder = process.cwd();
var myTheme = new Theme(
  'wejs-theme-default', // this is the npm module name of your theme
  projectFolder // you need to pass the project folder where the npm_modules/wejs-theme-default npm package are instaled
);

For more infos check we.js theme engine for one example or how to use this class with sails.js, link: https://github.com/wejs/we-theme-engine/blob/master/lib/themeHook.js

Helpers

Sails Helpers avaible in theme class

render

/**
 * Render one template with variables and template
 *
 * @param  {object} req      express js request
 * @param  {object} res      express.js response
 * @param  {string} template the template name
 * @param  {object} data     data passed to template
 */
// example:
theme.render(req, res, 'home/index');

Grunt helpers and all other helpers see

Check: https://github.com/wejs/we-class-theme/blob/master/lib/index.js

Links

Credits

Alberto Souza and contributors

License

MIT

Readme

Keywords

none

Package Sidebar

Install

npm i we-class-theme

Weekly Downloads

0

Version

0.0.4

License

MIT

Last publish

Collaborators

  • albertosouza
  • saviogl