-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Allow Cells to be auto-located within */Cells directories #6601
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An alternative which would offer a slightly broader feature (maybe desirable?) would be to use Factories
; this would allow View Cells to support the "modular unless overwritten by App" features characteristic of Models and Configs.
For example, if Shield published a LoginCell
then a developer would only need to supply app/Cells/LoginCell.php that extended it in order to use the replacement.
Just a thought; I like the improved locator skills generally.
I had considered using Factories for this, but was thinking more about the caching uses and thinking it wouldn't be worth it for this. So I could go either way on this. I'm not sure the memory usage would be worth it here. Although the "modular unless overwritten by App" aspect makes it tempting. I'll go ahead and try this with factories. |
Looks good with Factories! I'm fine with either way, was just an idea. Picked up a User Guide syntax warning:
|
I suggested the fixes for the docs. |
Co-authored-by: kenjis <kenji.uui@gmail.com>
@kenjis thanks for the docs updates. I've merged those. So I think we've covered everything. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🥳
Currently, when calling a View Cell you must enter the fully qualified class name. This change uses the
FileLocator
Factories
class to search for the class within*/Cells
directories, allowing a simpler naming in views and a more standardized location for them.So now we could do:
instead of
and it could be found in
app/Cells
,App/Modules/Blog/Cells
, or any other namespace'sCells
folder.