- This topic has 7 replies, 1 voice, and was last updated 2 months, 1 week ago by eurosat7.
- November 9, 2020 at 12:56 pm #1919Jess_PinkmanParticipant
Pure is similar to react in the sense that I can create reusable components.
It also makes my code more clean and readable.
Feedbacks would be appreciated.
composer require jesspinkman/pureNovember 9, 2020 at 12:56 pm #1920colshrapnelGuest
To me, this approach *is* the very mixing of html and PHP.
Some obvious drawbacks are:
– there are frontend devs who are a HUGE relief to us backend folks, taking up all the hassle with those tags and attributes. Now with Pure I got to translate every single HTML tag into a PHP code
– and then translate again when some changes to the design arrive
– there are powerful code inspectors for HTML too. Suppose none of them ever heard of your PHPTML
– now again some changes in the design and I got to find them in the source HTML files, and mash them into Puree
– none of the examples feature the JS. And I fear to see it in action.
– did I mention the small changes in the design that frontend dev would have been happy to do by himself, if only this approach weren’t used?November 9, 2020 at 12:56 pm #1921g105bGuest
Projects like this are great for training your PHP muscles. If you can push this to a polished version, I’m all for seeing you succeed. I do, however, concur with the general feedback in this thread, that the project seems to actually make the coupling between PHP and HTML even tighter.November 9, 2020 at 12:56 pm #1922Jess_PinkmanGuest
Well, I got bashed pretty badly lol
– I am self-taught developer (started 2 years ago)
– I mainly use wordpress, which has no native templating system.
– In my projects, all my views (=components / sub-components) are stored in a a specific folder (Views), so I do feel that I am splitting my views/controllers/models. A controller just calls whatever view is necessary, and passes along variables in the constructor. Genuine question, isn’t it the same concept as twig (which I never used) ?
– I still didn’t manage to make my wsl2/docker/vscode setup work with xdebug/phpunit, hence no testing, which I know is lacking.
– my projects are all full stack, no front end/back end guy.
Thanks for the feedbacks.November 9, 2020 at 12:56 pm #1923greenville008Guest
Why did you make this if you don’t like mixing html and PHP?November 9, 2020 at 12:56 pm #1924codemunkyGuest
You won’t receive any love for that here I’m afraid. I created something similar myself a while ago—and still use some small portions of it from time to time—but the community here is all about good software practices. Separation of concerns, model/view architecture, templates, etc etc, and will be against this as it’s semantically really no different to directly echoing out html.
I’m a *bit* past coding like this… 95%+ of this community are **light-years** past it.November 9, 2020 at 12:56 pm #1925HuliekGuest
I like this approach a lot better than a fully different language like Twig.
I created a similar POC https://gitlab.com/erikvv/hyperscript-phpNovember 9, 2020 at 12:56 pm #1926eurosat7Guest
This package has no test. ;-P
And it has no real use. The only usage it had was programming it.
Step it up: Write your own coding language having parser, lexer and linter. You will find out about operators and priority and ambiguous syntax problems. It can be a lot of fun.November 9, 2020 at 12:56 pm #1927AnonymousGuest
Can someone explain what the better alternative to this is?
I see multiple comments saying that “people are past this” or “html and php should be even less coupled.”
I’m not sure what people mean by that and I’m genuinely curious.
- You must be logged in to reply to this topic.