Closed ragboyjr closed 3 years ago
I'm going to be moving function components into the next release of v3 instead of bundling with v4.
But, I've been using these style components in a demo project of mine, and they are really easy to use and reason about. It's a totally different paradigm than the current templating model with plates, but I think it's better.
The new v4 components feature is nice, but it still feels like a decent amount of work to get a simple component up. Also, it forces each component to have it's own file, which feels like a bit much, especially if you want some components grouped together.
I've been using internally the
League\Plates\Util\obWrap
function to build simple components by calling functions instead of loading the component from a file.The syntax could be made more concise, but I think something like this could be like a gateway to building php templates similar to how you build React/View components.
Maybe a future syntax could be: