1. Go to this page and download the library: Download abstract/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/ */
use Abstract\AbstractCore;
use Abstract\Emitter\JsonEmitter;
use Abstract\Parser\Markup\MarkupParseOptions;
$core = new AbstractCore();
$tree = $core->parseHtmlFile('benchmarks/big-html.html', new MarkupParseOptions(
use Abstract\AbstractCore;
use Abstract\Emitter\JsxEmitter;
use Abstract\Mapper\ReactComponent;
use Abstract\Mapper\ReactMapper;
use Abstract\Render\RenderTarget;
$core = AbstractCore::default()
->withRenderTarget('jsx', RenderTarget::make(
ReactMapper::make()
->component('input', ReactComponent::imported(
source: '@headlessui/react',
export: 'Input',
as: 'HeadlessInput',
)),
new JsxEmitter(),
));
echo $core->renderJsx($tree);
use Abstract\AbstractCore;
use Abstract\Emitter\HtmlEmitter;
use Abstract\Mapper\HtmlElementMapping;
use Abstract\Mapper\HtmlMapper;
use Abstract\Render\RenderTarget;
$core = AbstractCore::default()
->withRenderTarget('html', RenderTarget::make(
HtmlMapper::make()
->element('input', HtmlElementMapping::tag('x-input')),
new HtmlEmitter(),
));
echo $core->renderHtml($tree);