Comments (8)
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.
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.
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.
@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.
@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.
@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.
@Giuseppe-Mazzapica feel free to release v0.6.4.
Seems to be working fine for me
Thanks again.
from foil.
@brad-jones thanks a lot for reporting and testing.
from foil.
Related Issues (20)
- SectionInterface::MODE_REPLACE causes child template inheritance to fail HOT 4
- Nested Blocks Fail HOT 4
- 0.6.4 is now repeating content sections within a loop HOT 8
- Some issues when creating custom helpers HOT 1
- Engine option to echo rendered output HOT 6
- Retrieve Data Inside Templates: loops HOT 14
- Code in overwritten sections runs HOT 2
- Option to not arraize some data HOT 1
- Arraization(?) is turning my Eloquent collections into strings (not arrays) HOT 1
- Trimming output? HOT 5
- New line in doRender of Engine class HOT 3
- Markdown Block HOT 2
- Duplicate code with nested sections HOT 3
- Link to blog post has no content HOT 2
- is not a valid template name HOT 1
- Development roadmap HOT 1
- Documentation website not working HOT 3
- Multiple section replace don't work HOT 2
- Post calls not working on PHP 7.1 HOT 3
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 foil.