The core building block of the Flynt Framework.
Switch branches/tags
Clone or download
Qakulukiam feat(BuildConstructionPlan, Render): add before & after actions (#46)
Added before and after actions to BuildConstructionPlan and Render. We can use this for logging and performance monitoring (and maybe more) in the future.
Latest commit 19efd48 Jul 19, 2018
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github docs(, .github): add community pages and add links in README ( Jun 19, 2017
lib feat(BuildConstructionPlan, Render): add before & after actions (#46) Jul 19, 2018
.coveralls.yml ci(coveralls): add config Mar 21, 2017
.editorconfig build(setup): initial commit Oct 31, 2016
.travis.yml ci(travis): update php coveralls dependency and constrain version (#47) Jul 19, 2018 docs(readme): add standard readme and license file Mar 24, 2017 docs(, .github): add community pages and add links in README ( Jun 19, 2017
composer.lock feat(composer): add composer installers and type wordpress plugin Jan 12, 2017
package.json chore(release): 1.0.0 Mar 27, 2017
phpcs.ruleset.xml style(PSR-2): change coding style to PSR-2 Mar 20, 2017


standard-readme compliant Build Status Code Quality Coverage Status

The core building block of the Flynt Framework.

The Flynt Core WordPress plugin provides a small public interface, combined with several WordPress hooks, to achieve the main principles of the Flynt Framework.

Table of Contents


This plugin essentially functions as a HTML generator with two key steps:

  1. Given a minimal configuration, the Flynt Core plugin creates a hierarchical plan for how the site will be constructed (the Construction Plan).
  2. The Construction Plan is parsed and rendered into HTML.

Each configuration passed to the plugin represents a single component. This configuration can also contain additional, nested component configurations, which are contained within "areas".


To install via composer, run:

composer require flyntwp/flynt-core

Activate the plugin in the WordPress back-end and you're good to go.


Hello World

To see the simplest way of using Flynt Core, add the following code to your theme's functions.php:

$componentManager = Flynt\ComponentManager::getInstance();

add_filter('Flynt/renderComponent?name=HelloWorld', function () {
  return 'Hello, world!';

This defines a new component ('HelloWorld'), which when rendered, will output the text 'Hello, world!'.

To render the component, add the following code to your theme's index.php:

  'name' => 'HelloWorld'

Initialize Default Settings

We recommend initializing the plugin's default settings. Do this by adding the following line of code to your theme's functions.php:


This will:

  • Implement the component structure.
  • Load component scripts.
  • Enable PHP file rendering.

This also adds the following hooks:

// Set the config path to './config'.
add_filter('Flynt/configPath', ['Flynt\Defaults', 'setConfigPath'], 999, 2);

// Parse `.json` config files.
add_filter('Flynt/configFileLoader', ['Flynt\Defaults', 'loadConfigFile'], 999, 3);

// Set the component path to `./Components`.
add_filter('Flynt/componentPath', ['Flynt\Defaults', 'setComponentPath'], 999, 2);

// Load ./Components/{$componentName}/functions.php from every registered component.
add_action('Flynt/registerComponent', ['Flynt\Defaults', 'loadFunctionsFile']);

// Render `./Components/{$componentName}/index.php` and make view helper functions `$data` and `$area` available (see explanation below).
add_filter('Flynt/renderComponent', ['Flynt\Defaults', 'renderComponent'], 999, 4);

With the 'Flynt/renderComponent' filter added above you can now use the following helper functions in your template files:

  • $data is used to access the component's data in the view template.
  • $area is used to include the HTML of an area's components into the components template itself.

You can read the full documentation here.


This project is maintained by bleech.

The main people in charge of this repo are:


To contribute, please use GitHub issues. Pull requests are accepted. Please also take a moment to read the Contributing Guidelines and Code of Conduct.

If editing the README, please conform to the standard-readme specification.


MIT © bleech