partial.js logo
Latest version
v1.3.1 (RC2)

How do definitions work?


Definition serves for setting of framework.



Starting partial.js project



Definition of Definition



// framework == Framework
// utils == FrameworkUtils

// Example:
framework.injectModule('test', 'http://www.partialjs.com/inject.js');

framework.custom = {};
framework.custom.myName = 'Peter Širka';

framework.config.secret += utils.GUID(5);

framework.helpers.now = function(format) {
	return new Date().format(format || 'dd.MM.yyyy');
}

// Set restrictions
framework.restrictions.disallow('192.168.0.1');
framework.restrictions.disallow('user-agent', /MSIE/);

// Set redirects
framework.redirect('http://partiajs.com', 'http://www.partialjs.com', true, true);