Git Product home page Git Product logo

Comments (6)

WyriHaximus avatar WyriHaximus commented on May 28, 2024

Did you add getVars through an extension? as Twig is only aware of functions you tell it about.

from legacy-twig-view.

TechFanDan avatar TechFanDan commented on May 28, 2024

As I'm unfamiliar with what you are proposing, I'm going to have to say no :)

ATM, I'm simply trying to modify my bake templates. I'm attempting to use available variables to accomplish this. The getVars was supposed to tell me what is available and to see what else I needed.

Edit #1: FWIW, I tried the same function in form.twig, in Templates and I get the same error.

from legacy-twig-view.

ndm2 avatar ndm2 commented on May 28, 2024

getVars() is a function provided by https://github.com/WyriHaximus/TwigView/blob/a5ec66690aa045d6eda17ab1c8a5baf0efdcfa45/src/Lib/Twig/Extension/View.php#L51-L53

but the extension is missing in https://github.com/WyriHaximus/TwigView/blob/a5ec66690aa045d6eda17ab1c8a5baf0efdcfa45/src/Event/ExtensionsListener.php#L64-L73

from legacy-twig-view.

TechFanDan avatar TechFanDan commented on May 28, 2024

FWIW, I attempted to load the missing extension View. However, it seems the constructor requires a CakeView parameter which is missing and throwing an error.

from legacy-twig-view.

ndm2 avatar ndm2 commented on May 28, 2024
$event->getTwig()->addExtension(new Extension\View($event->getTwigView()));

from legacy-twig-view.

TechFanDan avatar TechFanDan commented on May 28, 2024

That works, no more errors. From the variables listed, I'm not seeing what I need. That's for another day :)

from legacy-twig-view.

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.