Code Monkey home page Code Monkey logo

Comments (8)

gmazzap avatar gmazzap commented on August 26, 2024

Hi @brad-jones and thanks for your interest in Foil!

Sorry, but I tested your exact example and supply() works as expected.

I think your problem is in <?php $T->layout('layouts/master') ?>

Using layouts/master and having instantiated the engine with 'folders' => ['/views'], Foil will search for views/layouts/master.php, are you sure that is the right path?

from foil.

gmazzap avatar gmazzap commented on August 26, 2024

I created a Gist with all the files I used to test this issue https://gist.github.com/Giuseppe-Mazzapica/6e3ae0aeb8e9fce54818 You can download it, and after composer install you can see that the rendered content is what expected...

from foil.

brad-jones avatar brad-jones commented on August 26, 2024

Hi @Giuseppe-Mazzapica,

Ok I got to the bottom of it, I knew I wasn't crazy.
Have a look at: https://gist.github.com/brad-jones/6279ce76cbedc2584675

Let me know what you think. For now my quick fix is to make sure the Foil engine is newed up each time it is requested from my DI container.

Cheers Brad

from foil.

gmazzap avatar gmazzap commented on August 26, 2024

@brad-jones Ok, I see the issue. This is something that was noted already and fixed when sections are rendered using template inheritance (see #25), but was not fixed when sections are used with supply().

I'll fix this as soon as possible.

from foil.

gmazzap avatar gmazzap commented on August 26, 2024

@brad-jones it should be fixed now.

Can you please require Foil from dev-master and give it a try? If it works I'll release 0.6.4 including this change.

I ran the test in your Gist (https://gist.github.com/brad-jones/6279ce76cbedc2584675) replacing

"require": {
    "foil/foil": "*"
 }

with

"require": {
    "foil/foil": "dev-master"
}

in composer.json and it works, but some tests in real world project would be nice.

Thanks for reporting!

from foil.

brad-jones avatar brad-jones commented on August 26, 2024

@Giuseppe-Mazzapica mate you are a legend!

I just got into the office, I will get back to you in the next few hours with some real world testing in my wordpress theme.

from foil.

brad-jones avatar brad-jones commented on August 26, 2024

@Giuseppe-Mazzapica feel free to release v0.6.4.

Seems to be working fine for me

Thanks again.

from foil.

gmazzap avatar gmazzap commented on August 26, 2024

@brad-jones thanks a lot for reporting and testing.

from foil.

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.