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

ViewFile helpers accessible via $this in views #37

Closed
carbontwelve opened this issue Jan 4, 2017 · 1 comment
Closed

ViewFile helpers accessible via $this in views #37

carbontwelve opened this issue Jan 4, 2017 · 1 comment
Assignees
Milestone

Comments

@carbontwelve
Copy link
Member

An issue raised in both #32 and #30 is that the ViewFile class which is passed to the view within a collection which the view has asked for via use frontmatter, contains helper methods that are not available within the context of $this for each page.

For example a collection of blog posts passed to a category view will be an array of the ViewFile class (either via use or pagination it doesn't matter) and the ViewFile class contains useful methods such as getDate('d-m-Y') and getUrl().

It may be duplicating code having the same code in a plates extension as well as the ViewFile class so possibly the use of a trait containing the shared methods could work best in this case?

This is marked up as both a bug and an enhancement, the bug is that ViewFile helpers are not available within a view via $this and the enhancement is adding that missed functionality.

@carbontwelve
Copy link
Member Author

This is fixed by 886b3f8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant