Skip to content

Commit

Permalink
Add a couple of details to ITemplateHelpers docs
Browse files Browse the repository at this point in the history
  • Loading branch information
Sean Hammond authored and tobes committed Feb 22, 2013
1 parent 7bca148 commit aee8d37
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions ckan/plugins/interfaces.py
Original file line number Diff line number Diff line change
Expand Up @@ -521,10 +521,16 @@ class ITemplateHelpers(Interface):
'''
def get_helpers(self):
'''Return a dict mapping names to helper_functions.
'''Return a dict mapping names to helper functions.
The keys of the dict should be the names of the helper functions, and
the values should be the functions themselves.
The keys of the dict should be the names with which the helper
functions will be made available to templates, and the values should be
the functions themselves. For example, a dict like:
``{'example_helper': example_helper}`` allows templates to access the
``example_helper`` function via ``h.example_helper()``.
Function names should start with the name of the extension providing
the function, to prevent name clashes between extensions.
'''

Expand Down

0 comments on commit aee8d37

Please sign in to comment.