Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to easily pass the current context. #83

Closed
wants to merge 2 commits into from

Conversation

jasonhofer
Copy link

Pass the current context to sub-templates, and non-destructively alter or add data to that context.

Usage:

$this->render('navbar', $this->context());
$this->insert('partials/form', $this->context(array('action' => 'edit')));

@ragboyjr
Copy link
Contributor

This essentially does the same as #77. I think I prefer implicitly allowing the parent data to be accessed in sub views.

@reinink
Copy link
Contributor

reinink commented Dec 27, 2016

Thanks for making this contribution! However, I'm not sure this is needed since you can already pass data to sub templates:

$this->render('navbar', $this->data);
$this->insert('partials/form', ['action' => 'edit']);

We're looking at making template data available to all templates in the 4.x release. Please see #136 for more info.

Thanks again for your interest in this library!

@reinink reinink closed this Dec 27, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants