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
Problem: The $defaultLayoutsDir must be kept in sync with the framework which at present defines it as layouts/. Even though that value may not ever change, it is still something the user should not have to write as it is framework-specific behaviour.
Proposed Solution 1: getLayoutsDir() should return layouts/. This would appear to be the correct behaviour since layouts/ is really the default directory. Currently getLayoutsDir() returns an empty string, which is technically a lie. Though I would prefer this, I understand that it can break backward compatibility for a lot of users.
Proposed Solution 2:
Add View::existsLayout and View::existsPartial.
As an aside, layouts/ is hard-coded in the view and these would be better off assigned to a variable so they can be re-used.
I'm closing this issue due to the lack of any reaction and I don't want a bunch of these lying around. I'd like to add support for anything/everything at some point, but keeping the issue open doesn't help that. If anyone wants to get started, I'd love that.
Thanks for adding View::exists, it is really handy. However, when checking for existence of layouts and partials there are still a few issues.
The above is a naive approach. The more correct approach is:
Problem: The
$defaultLayoutsDir
must be kept in sync with the framework which at present defines it aslayouts/
. Even though that value may not ever change, it is still something the user should not have to write as it is framework-specific behaviour.Proposed Solution 1:
getLayoutsDir()
should returnlayouts/
. This would appear to be the correct behaviour sincelayouts/
is really the default directory. CurrentlygetLayoutsDir()
returns an empty string, which is technically a lie. Though I would prefer this, I understand that it can break backward compatibility for a lot of users.Proposed Solution 2:
Add
View::existsLayout
andView::existsPartial
.As an aside,
layouts/
is hard-coded in the view and these would be better off assigned to a variable so they can be re-used.Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.
The text was updated successfully, but these errors were encountered: