Giter Site home page Giter Site logo

Comments (9)

ericmorand avatar ericmorand commented on August 16, 2024 1

@nicolas-grekas

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.

onlinesid avatar onlinesid commented on August 16, 2024 1

@nicolas-grekas any handy documentation / link / example of this 'CaptureNode' thing?

from twig.

fabpot avatar fabpot commented on August 16, 2024

The problem in your code is that you're using the ob_* functions, which is an internal implementation detail.

from twig.

nicolas-grekas avatar nicolas-grekas commented on August 16, 2024

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.

ericmorand avatar ericmorand commented on August 16, 2024

@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.

nicolas-grekas avatar nicolas-grekas commented on August 16, 2024

Using CaptureNode I suppose?

from twig.

ericmorand avatar ericmorand commented on August 16, 2024

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.

nicolas-grekas avatar nicolas-grekas commented on August 16, 2024

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.

chesn0k avatar chesn0k commented on August 16, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.