I have a template that outputs some JSON formatted data.
I've built a simple module that needs to get the contents of that template, decode the JSON data, and return it.
I believe I need to use
craft()->templates->render('path/to/template'), but when I do, I get:
Call to undefined function modules\importjsonmodule\twigextensions\craft()
The only explanation I can think of is that
craft() cannot be used in a module in the way it can in a plugin. Is that the case? If so, is there any way I can access the Templates service from within a module?