Custom plugins and function namespaces

27 views
Skip to first unread message

Marcel Overdijk

unread,
Apr 12, 2013, 2:33:37 AM4/12/13
to Closure Templates Discuss
When I write a plugin that provides some addition functions I wonder
if they can be namespaced.

E.g. I have a smart 'input' function to generate a html input with id,
name, value etc.
I would like to bind this custom function to a namespace (maybe not
the correct term).

This is similar as jsp taglibs where you would do something like:
<mytaglib:input>
I want to namespace to avoid any future clashes with the names of my
functions.

I could of course use something like {mytaglib_input} but I wonder if
there are better ways to use namspaces for functions.

The most optimal case would also be that when registering my plugin,
that I would be able to provide the namespace I want to use for the
functions within the plugin.
I think something like this makes sense to provide 3th party plugins
which provide new functionality.
But this also raises another question, how should I register a custom
plugin so I can access it's functions? The docs on plugins are a
little bit sparse.


Cheers,
Marcel
Reply all
Reply to author
Forward
0 new messages