- Some more documentation made / fixed
This commit is contained in:
1 parent
46535c2734
commit
58f73d914b
9 files changed
+49
-41
No files matched your search
@@ -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) ?>";
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user