Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with register function method in library #9

Open
DurbanVisuals opened this issue Jul 29, 2015 · 3 comments
Open

Issue with register function method in library #9

DurbanVisuals opened this issue Jul 29, 2015 · 3 comments

Comments

@DurbanVisuals
Copy link

Thanks for this first of all. But I am getting this error when calling the method to add a custom function:

Message: Argument 2 passed to Twig::register_function() must implement interface Twig_FunctionInterface, none given,

And I was calling something like this $this->twig->register_function('test', $template);

@bmatschullat
Copy link
Owner

@DurbanVisuals
Copy link
Author

No I was trying to load a custom function to my Class, should I register a function with CI first then pass to your method? The other registered functions work great just haven't had success with anything custom / not in CI

@bmatschullat
Copy link
Owner

it was only nesasary that the first parameter of addFunction was a string and the second one was something like "new Twig_Function_Function('YOUR_FUNCTION_NAME')

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants