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
Implement block() function #88
Comments
In terms of architecture, this feature will require functions to have access to the rendering context. This possible by changing the function api. I had a tech task in mind which could be picked up here. Basically I would like to make functions more developer friendly. That is possible if we use reflection strategies like spring to run functions. By doing so we simplify all function implementations (removing the initial requires validation) by havinf Java defined arguments. Then, for this story we just need to have a function which will receive this special argument, the rendering context. |
Yeah, functions API should be refactored for sure, because similar kind of functionality we will need in the parent() function. |
I'm doing some work on it. But I'm talking about this: http://docs.spring.io/spring/docs/3.2.x/spring-framework-reference/html/mvc.html#mvc-ann-typeconversion |
…ns using type safe Java methods.
I was moving toward implementation on this one, but realized that as the jtwig-functions module is separate from the jtwig-core module, |
Try creating the function in the jtwig-core itself. That's what I was thinking about. |
Okay, I should be able to do that!
|
Add block function persuant to #88
The |
This one IMO is very important to have, allows a lot of flexibility for re-usability and composition of templates. Used a lot in symfony forms twig extension here which I am considering to port (at least partially) to jtwig as independent module.
http://twig.sensiolabs.org/doc/functions/block.html
I didn't look into code yet for particularly this one, but it feels like it should be some kind of functionality which would insert duplicates into the render objects tree.
The text was updated successfully, but these errors were encountered: