You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 viause
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 viause
or pagination it doesn't matter) and theViewFile
class contains useful methods such asgetDate('d-m-Y')
andgetUrl()
.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.The text was updated successfully, but these errors were encountered: