My dislike of WordPress is no secret. I look down on its mess of a code base, and advise anyone with any technical knowhow whatsoever against using it. But I don’t just bash it for the sake of bashing, I bash it in the hopes that someone who knows what they’re doing will pick up the baton one day and continue the popularity race in a more logical, sensible pace. Any attempt to fix the mess WP presents us with day in day out is, in my book, a good one.
Not too long ago, we heard of a new project on the horizon called Themosis, a “framework for WordPress developers”. In this piece, we’ll try and see what Themosis is, how to get started using it, and we’ll take a look at an example project built with it - the example provided by Themosis themselves.
What is Themosis
To anyone familiar with the word “framework”, especially in the context of PHP, this might sound confusing. Isn’t WP already packed full with stuff we don’t need? Aren’t frameworks usually built on a minimalistic set of principles and decoupled components, and complex WordPress-like apps built on top of them, instead of the other way around? Well, yes.
Themosis isn’t a framework in the full sense of the word as you know it. Instead, it’s an API that ties into WP on a level required to make it easier to develop in - but doesn’t necessarily make it lighter. Themosis is a set of APIs that you use to create WordPress components in a modern-PHP format with namespaces, classes, anonymous functions and Composer support.
Themosis is, quite literally, an MVC powered Laravel-ish WP plugin itself that’s used to write other plugins. It also has its own router so you can define routes Laravel-style, and its own templating engine - Scout - that’s similar to what we’re used to in Laravel and Phalcon - with some added extras for built in WordPress support. For example, the template loop:
@loop(array('post_type' => 'post', 'posts_per_page' => -1))
{{ Loop::title() }}</</span>h1>
uses WP API to get to the data it requires, and theLoop
class is designed only to be used with loops for underlying WP content.
Continue reading %First Look at Themosis, a Framework for WordPress Developers%
more
{ 0 comments... » First Look at Themosis, a Framework for WordPress Developers read them below or add one }
Post a Comment