8 ms·
Acorn – Use Laravel Inside WordPress
- acomjean 2y agoI work on a website for a non-profit. We have a hybrid wordpress symfony site. We're always being pulled two ways, we like that we switched to wordpress for the more static parts of the site (CMS). We have some minor custom functionality thats being handled by symfony, that should righly be a wordpress plug in.... This might be the thing. Especially if you can use it for plug-ins.
- pluc 2y agoYou'd just be switching one framework for another really. Either make it framework agnostic or make it use the framework you're already using (wordpress)... anything else is unnecessary overhead
- rob 2y agoI'm not sure if this helps, but there's also Corcel — sort of the opposite of Acorn: https://github.com/corcel/corcel https://github.com/corcel/corcel > Corcel is a collection of PHP classes built on top of Eloquent ORM (from Laravel framework), that provides a fluent interface to connect and get data directly from a WordPress database.
- deleted 2y ago[deleted]
- AstroJetson 2y ago> We have a hybrid wordpress symfony site I was trying to get it set up so I could use twig templates inside pages. I couldn't get it to work since both frameworks ( Wordpress & Symfony) want to be in charge. Any secrets you can impart?
- deleted 2y ago[deleted]
- charlie0 2y agoFrankstein-ing frameworks like this is asking for trouble. This smells like something that was made by devs because they hated working on WP, not understanding that the reason why WP is picked if often due to political reasons, not technical ones. I predict two forces will turn these kinds of projects into spaghetti: Actual devs working on resolving issues with code, less technical people fighting to use plugins and other add-ons to add functionality.
- rob 2y ago> This smells like something that was made by devs because they hated working on WP, not understanding that the reason why WP is picked if often due to political reasons, not technical ones. Made by the roots.io team, who have been doing this since 2011: https://roots.io/about/ https://roots.io/about/ Other projects in this space include: https://roots.io/sage/ https://roots.io/sage/ https://roots.io/bedrock/ https://roots.io/bedrock/ Great projects!
- jrgd 2y agoI second this; have been using Roots “frameworks” for years now and cant state enough how great this is compared to wordpress-traditional-workflow. It’s great.
- newzisforsukas 2y agoLaravel itself is a Frankenstein with Symfony, so...
- solarkraft 2y ago> This smells like something that was made by devs because they hated working on WP, not understanding that the reason why WP is picked if often due to political reasons, not technical ones But that’s the point? When WP is picked for political reasons, this is how you can make it nice on the technical side.
- ochrist 2y agoOh no. Acorn was - and is - the then famous Acorn Computers. Makers of the BBC computer and eventually the inventor of the ARM processor (first used in the Archimedes range of computers). Please use another name (end of rant).
- yurishimo 2y agoThis project is over 5 years old.
- askonomm 2y agoUnfortunately any PHP devloper worth their money knows that developing WP sites, even if you follow the WP's standard to the T, is a horrible experience riddled with anti patterns. But, to try to remedy that by duct-taping an entirely different framework on top doesn't, to me at least, make things any better. In fact, it makes it worse - now there's two frameworks to maintain.
- abanana 2y agoEspecially if you follow the WP's standard to the T. Wordpress coding "standards" came from one person's idiosyncrasies, going against most other coding standards including (especially) the PSR ones. It's a while since I last looked at contributors' attempts to bring some sanity to it all, but the last I saw was that they kept getting knocked back by the gatekeepers.
- stephenr 2y agolook you couldn't pay me any amount of money to work on Wordpress, but not cargo culting PSR like a bunch of others isn't the red flag you make it out to be. I was dubious when they declared that projects indent method is somehow a barrier to "interoperability". When they made a logging system based on strings because one existing implementation was written by a guy who apparently doesn't understand syslog levels, I gave up any expectation that they'd produce anything of value. It's design by committee with the added bullshit of wanting to emulate Java.
- 9dev 2y agoPSR has been the single most important advance in the ecosystem. We now have a single, unified code style among all modern projects; a universally supported logging library that virtually all applications use; a universally supported DI container that is implemented by all frameworks; common HTTP request and response types, used or supported by all major frameworks and HTTP clients alike; sadly, two cache standards, albite with a little different targets, but at least most packages support either. For a concrete example; I can take a PSR request received from the server SAPI, send that to an upstream server via a PSR client retrieved from a PSR container, hand it a PSR cache instance to store the PSR response in, then return that response to the client. This whole chunk of code can be copy-pasted from Laravel to Symfony, and the container will handle injecting the correct local implementation. That doesn’t sound too impressive to a Java developer, but it just wasn’t there in PHP before PSR. Anyone dismissing all that hasn’t really worked on libraries and frameworks before that was a thing. These packages have made it feasible to create framework-agnostic libraries, easy even, if you’ve got a bit of PHP experience. There’s a reason why the packagist/composer ecosystem is so good, and that’s shared primitives. If someone just denies all that and bets on their own, badly documented, incompatible solutions just for the sake of it; that absolutely is a red flag, and I’m not going to touch that with a ten foot pole.
- wizzzzzy 2y agoHaving used acorn (via roots sage) on a project recently I'd say on balance it does improve working with Wordpress. I wouldn't describe it as a nice experience though.