ez projects / wrap_operator
| UNIX name | Owner | Status | Version | Compatible with |
|---|---|---|---|---|
| wrap_operator | Brookins Consulting | stable | 1.0.1 | 4.0+ |
Essentially, this is a simple wrapper operator to directly call any system and user-defined functions in template.
It does not concern me much if doing so is good idea or ' pfui' as someone said once on the #ezpublish irc channel.
Undoubtedly care has to be taken to avoid security and caching problems, etc.
But it makes life a lot easier for me because I don't have to re-implement / write existing text processing functions in template language and do not need to set up separate extension to every small operator I need.
It's a swiss army knife - you can cut your hand but no one is forcing you to :)
I am not sure exactly what datatypes can be passed to functions from template like this.
Should work ok for integers, strings and boolean I think. If you are more informed about ez internals, please comment.
Using wrap_user_func with return_output=true() should enable easy embedding of existing php applications in templates, called through the user function. I have tested just simple test case but maybe someone can think of something more useful and post specific instructions..
You can obtain the source code for this extension on GitHub
https://github.com/brookinsconsulting/wrapoperator
Alternatively you may obtain a copy of the latest packaged edition from the projects.ez.no downloads for this project.
Wrap Operator sources migrate to GitHub
Monday 28 November 2011 06:18
Brookins Consulting