docs
docs copied to clipboard
Extenders are not using the same wording
When I look at the Routes extender the construct uses the variable $appName, the Frontend uses $frontend. I'm confused about the difference in naming. I know about Site vs App, but is this what was actually meant by them?
They are similar but subtly different.
An installed Flarum App has three "apps": forum, admin, and API. These each have their own set of routes which you can add to.
Most of the forum and admin routes serve up a "frontend" which can be extended using the Frontend extender.
Indeed. I am open for better wording here, but these are definitely very distinct concepts:
- an "app" is a set of HTTP request handlers, with middleware and routes
- a "frontend" is a HTML document / single-page app
I was already afraid they might be different, knowing Site vs App. However for a new extension developer this might be terminology which is hard to grasp, hence the question; can we improve this or has this been sufficiently documented?
@flarum/docs
I'm not sure how we could improve the wording. In one case, app clearly refers to the whole app and frontend just to the frontend.
Maybe making frontend be view or render, something similar to that?
If not that, how does Laravel do it? Are we doing it like them or is their wording a bit clearer (ignoring all those Facades, Service Containers, etc... :P)
I think the words are fine, we just need to make it clear in the documentation (and docblocks).
@datitisev It's not really a concept from Laravel. They have no abstraction for what we call "frontend", and "apps" are somewhat similar to Laravel's route groups, though not a perfect match.
We have to explain the concepts well, no way around that. :wink: