slimphp / PHP-View

A Simple PHP Renderer for Slim 3 & 4 (or any other PSR-7 project)
MIT License
264 stars 60 forks source link

Added minimal support for layouts #38

Closed cholthi closed 5 years ago

cholthi commented 6 years ago

This PR adds ability to wrap view templates inside layouts. This is very simple implementation that just renders templates inside other templates called layouts. This PR doesn't support advanced techniques like template inheritance and extending as it would make the package heavy and conflict the SLIM principle.

Tests are in the tests directory and tests the same scenarios as original tests of the package. Hope you like it!

geggleto commented 6 years ago

I will look at this on Friday or this weekend.

akrabat commented 6 years ago

I've not looked in detail, but my first obvious comment is that to maintain BC, the layout path has to be the last parameter to render() and must be optional.

cholthi commented 6 years ago

@Rob Allen Yes you're right. I was actually the first victim of BC. Will definitely find a way to keep things BC

On Tue, Nov 28, 2017 at 9:55 AM, Rob Allen notifications@github.com wrote:

I've not looked in detail, but my first obvious comment is that to maintain BC, the layout path has to be the last parameter to render() and must be optional.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/slimphp/PHP-View/pull/38#issuecomment-347530331, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQci6_k84oAJ6lLRQ9oaKideDXvuFaBks5s7BDJgaJpZM4QtIWh .

tealborder commented 6 years ago

I like this

basteyy commented 6 years ago

@cholthi will you update the code somewhen?

cholthi commented 6 years ago

Let me look into it this week

On Tue, 21 Aug 2018 21:30 bas tey notifications@github.com wrote:

@cholthi https://github.com/cholthi will you update the code somewhen?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/slimphp/PHP-View/pull/38#issuecomment-414776271, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQci_fye5hHAF4OXgi4auFXYSIB1lZ7ks5uTFG9gaJpZM4QtIWh .

mazeeblanke commented 5 years ago

Why has this PR not been merged ?

cholthi commented 5 years ago

@akrabat why?

On Tue, Oct 30, 2018 at 2:02 PM debugMonstar notifications@github.com wrote:

Why has this PR not been merged ?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/slimphp/PHP-View/pull/38#issuecomment-434257856, or mute the thread https://github.com/notifications/unsubscribe-auth/AEQcizPw4ivGU3Q6l9Q49js2dKzw6BRBks5uqDHPgaJpZM4QtIWh .

akrabat commented 5 years ago

@mazeeblanke Because the BC issue hasn't yet been addressed.