PHP code example of flyntwp / flynt-core

1. Go to this page and download the library: Download flyntwp/flynt-core library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

flyntwp / flynt-core example snippets


$componentManager = Flynt\ComponentManager::getInstance();
$componentManager->registerComponent('HelloWorld');

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

Flynt\echoHtmlFromConfig([
  'name' => 'HelloWorld'
]);

Flynt\initDefaults();

// 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);