dwoo-project / dwoo

[UNMAINTAINED] php template engine
http://dwoo.org
GNU Lesser General Public License v3.0
167 stars 58 forks source link

How to include own Functions ? #21

Closed rottmann closed 10 years ago

rottmann commented 10 years ago

I copy FunctionCapitalize to my own dir and rename it. But how can i use/include my function ?

The documentation only say add through \Dwoo\Loader::addDirectory.

But i got an error

Fatal error: Uncaught exception 'Dwoo\Exception\CompilationException' with message 'Compilation error at line 8 in "file:Component/Project/Views/add.tpl" : Type error for bla with type2' in /var/www/test/Vendor/dwoo/dwoo/lib/Dwoo/Compiler.php:806 ...
class FunctionBla extends Plugin {
// same as FunctionCapitalize
Template: {bla('test')}

Can you provide me an example ?

emulienfou commented 10 years ago

Can you update your code from the last commit and tell me if you have the same bug ?

rottmann commented 10 years ago

Thanks, seems to work.