- Start building your application
The Themosis framework is a pre-configured stack to develop WordPress website and application. It comes with a plugin
themosis-framework which contains the APIs and a theme
themosis-theme where you'll write your application/website code.
We suggest you to rename the default
themosis-themefolder name to better match your project (Note: you can also remove the composer dependency statement themosis/theme in your composer.json file).
Let's take a look at the framework plugin and theme structures.
The plugin only contains the APIs to help you build and develop your WordPress website or application.
themosis-frameworkpackage is installed inside the
mu-pluginsfolder. So there is no need to activate it once WordPress is installed.
The plugin gives you classes to easily create or handle: custom post types, metaboxes, custom fields, custom pages, settings, taxonomies, assets, ajax, controllers, views, models, routes and more.
We suggest you to change the
themosis-themefolder name to match your project.
themosis-theme is stored in the
htdocs/content/themes/ folder of your project. The theme contains a
resources directory. This is the main folder where you write your code for building your application/website's theme.
Let's take a look inside this
admin/: This folder is an extension of the classic
functions.phpfile. You can add as many files as you want at its root. As the name suggests, this is where you'll write your code in order to shape the WordPress administration and set your data: custom post types, metaboxes, custom fields, pages,... Note: The framework will load your files in alphabetical order. An
application.phpfile are loaded by default.
config/: Contains the theme configuration files:
templates. Read the configuration guide for more information.
controllers/: This folder stores all your controller classes.
models/: Stores your model classes.
views/: This folder contains your views - HTML. You can point to sub-directories using a dot syntax.
widgets/: Contains your widget classes.
routes.php: This file handles your website routes. The route system behaves like an "if" statement on steroids. Read the routing guide for more information.
Start building your application
Currently, in order to build your application or website, you write your code inside the
themosis-theme/resources folder only.
Let's start by looking at the route API.
Read the routing guide