Webfan UI - Concept 4
Webfan is now testing the new successor of an UI concept implementing components that has been around in the stack since years.
It is based in the following components or forks of them:
- StartDir\Html\Container Compiles and renders HTML. It uses
- ivopetkov/html-server-components-compiler fork Webfan\Webfat\HTMLServerComponentsCompiler and the insane PHP-NodeJs-styler Webfan\Script\Modules
- krzksz/phcompile for Angularifary!
- Angularifary scopify-fetch Directive is used to asynchronous update the pre-rendered Server-HTML in the browser: Example:
<spanscopify-fetchurl="https://webfan.de/@<?php echo $component->subject; ?>/actor.json"interval="35"increaseinterval="15"globalremovemissing="false"assign="ItemActor"transform="actorTransform"></span> - mmamedov/page-cache is needed in the front/top of the UI-Controller as the above rendering can be extremely slow!!!
Example Code-Snippet:
First register shut down function to output the HTML-Document finally:
$ShutdownTasks = \frdlweb\Thread\ShutdownTasks::mutex();
$ShutdownTasks(function($ItemUpdater){
$str = @$ItemUpdater->context()->html()->compileScope( Config::get('context.scope') );
$str = str_replace(['</head>'], ['</head><body>'], $str).'</body>';
echo '<!DOCTYPE html>
<html>'.$str.'</html>';
}, $ItemUpdater);
Then write HTML:
$ItemUpdater::context()->html()->write('
<component src="file:'.__DIR__.'/template-main.php" subject="'.getenv('WEBFINGER_HANDLE').'" description="'.$ItemUpdater->getItem()->getData()['description'].'" />
');

Comments
StartDir\Html\Container:
https://startdir.de/install/?source=StartDir\Html\Container
StartDir\Html\Container:
https://startdir.de/install/?source=StartDir\Html\Container