- Some more documentation made / fixed

This commit is contained in:
mcndave committed 2022-12-22 14:35:26 +00:00
1 parent 46535c2734
commit 58f73d914b
9 files changed
+49 -41

No files matched your search

+7 -11
View File
@@ -2,23 +2,19 @@
namespace Picea\Extension;
use Picea\Compiler\Context;
class TitleExtension implements Extension {
class TitleExtension implements Extension, FunctionExtension {
public string $token = "title";
public string $title = "";
public function __construct(Context $context) {
$this->register($context);
public function exportFunctions(): array
{
return [
"title" => [$this, 'handleTitle'],
];
}
public function register(Context $context) : void
{
$context->pushFunction("title", [ $this, 'handleTitle' ]);
}
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) {
return "<?php echo title($arguments) ?>";
}