Comments (9)
Twig needs to move forward
That's why major version bump exists. There is no reason not to having pushed a new major version here.
from twig.
@nicolas-grekas any handy documentation / link / example of this 'CaptureNode' thing?
from twig.
The problem in your code is that you're using the ob_*
functions, which is an internal implementation detail.
from twig.
Unfortunately your implementation relies on output buffering, which is not used anymore internally.
You might want to consider using a CaptureNode instead since this one should be compatible with all versions of Twig.
I'm closing because there's nothing we can do here.
from twig.
@nicolas-grekas so, if using ob_*
was an internal implementation detail, what was the non internal way to achieve what the OP achieved?
from twig.
Using CaptureNode I suppose?
from twig.
There is no CaptureNode in Twig 3.8. So, if ob_*
were internal details, how were people supposed to write capture-like nodes before 3.9?
from twig.
Ah OK, so yes, ob_start was the way to go. Note that I'm just trying to help. Yes, we could consider some BC break here. Unfortunately, that's the kind if low-level stuff that's really hard to deal with. Twig needs to move forward and using yield makes it way better. Some extensions do need to adapt, that's true.
from twig.
I used SetNode Chi-teck/drupal-code-generator@89a6b47#diff-659f570da976dbf4397a186b8703135e6aad1de658e365e4dd882d8bf06336d5R36
It not be the best solution, but maybe it will be useful for someone.
BTW I think we will abandon the tag in favor of a filter
from twig.
Related Issues (20)
- loop.last with generator should throw an exception HOT 2
- Inconsistent behavior of "date" filter with locales
- Inconsistency between EscaperExtension and EscaperRuntime HOT 4
- Performance regression since v3.9.0 HOT 1
- Element at index of filtered array throws exception HOT 3
- Twig Extension no longer rendering output HOT 20
- providing locale hangs php
- EscaperRuntime::setSafeClasses() implementation HOT 2
- Ability to mark nodes as implicitly safe HOT 4
- Site Repository ? HOT 1
- Add tree tag to Twig 4.0 HOT 1
- ranged for loop HOT 4
- yield used when use_yield = false
- Is the `_parent` value present in the context supposed to be iterated on by the `for` tag? HOT 3
- Behaviour of `cycle` function & mappings
- Add var tag to declare variable types [WIP] HOT 7
- Deprecated functions in Resources directory cause collisions HOT 5
- `IntegrationTestCase` does not trigger deprecation checks for multiple `--DATA--` HOT 3
- [v4] Uncomment `/* Token::X */` references HOT 1
- [Twig\Loader\ChainLoader] Constructor could accept iterable instead of array.
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from twig.