1. Go to this page and download the library: Download itineris/sage-flbuilder 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/ */
itineris / sage-flbuilder example snippets
class Helper extends AbstractHelper
{
/**
* Full path to PostGrid template directory.
*
* @return string
*/
public function getPostGridTemplateDir(): string
{
return __DIR__ . '/post-grid';
}
}
namespace App\Plugins\FLBuilder;
use Itineris\SageFLBuilder\AbstractHelper;
class Helper extends AbstractHelper
{
// Implement all abstract methods.
}
use App\Plugins\FLBuilder\Helper;
use Itineris\SageFLBuilder\SageFLBuilder;
$sageFLBuilder = new SageFLBuilder(
new Helper()
);
$sageFLBuilder->init();
namespace App\Plugins\FLBuilder\Modules\RunnerBlock;
use Itineris\SageFLBuilder\AbstractModule;
use Itineris\SageFLBuilder\AbstractHelper;
class RunnerBlock extends AbstractModule
{
/**
* Register the module and its form settings.
* If needed, register a settings form to use in the "form" field type.
*/
public static function register(): void
{
// Invoke `\FLBuilder::register_module` here
// Invoke `\FLBuilder::register_settings_form` here
}
public function __construct()
{
/** @var AbstractHelper $helper */
$helper = sage(AbstractHelper::class);
parent::__construct([
'name' => __('Runner block', 'fabric'),
'description' => __('Runner block widget', 'fabric'),
'category' => 'Basic',
'group' => $helper->getModuleGroup(),
'dir' => __DIR__,
'url' => $helper->assetPath(__DIR__),
'icon' => 'layout.svg',
]);
}
}
use App\Plugins\FLBuilder\Helper;
use App\Plugins\FLBuilder\Modules\RunnerBlock\RunnerBlock;
use Itineris\SageFLBuilder\SageFLBuilder;
$sageFLBuilder = new SageFLBuilder(
new Helper()
);
$sageFLBuilder->add(RunnerBlock::class)
->init();
namespace App\Plugins\FLBuilder\Modules\BladeRunnerBlock;
use Itineris\SageFLBuilder\AbstractBladeModule;
class BladeRunnerBlock extends AbstractBladeModule
{
// Similar to custom PHP module
}
namespace App\Plugins\FLBuilder\Settings;
use Itineris\SageFLBuilder\InitializableInterface;
class MySetting implements InitializableInterface
{
// Implement all