- Added documentation, fixed some bugs and optimized some parts of the source code while doing the doc.
This commit is contained in:
1 parent
9190987b53
commit
3986437800
33 files changed
+431
-16
No files matched your search
+6
-4
@@ -7,9 +7,10 @@ use Picea\Extension\Extension,
|
||||
|
||||
use Picea\Compiler\Context;
|
||||
|
||||
use Picea\Extension\FunctionExtension;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class Form implements Extension {
|
||||
class Form implements Extension, FunctionExtension {
|
||||
use ExtensionTrait;
|
||||
|
||||
public array $tokens;
|
||||
@@ -22,14 +23,15 @@ class Form implements Extension {
|
||||
|
||||
public function __construct(ServerRequestInterface $request, Context $context) {
|
||||
$this->request = $request;
|
||||
$this->register($context);
|
||||
}
|
||||
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) : string { }
|
||||
|
||||
public function register(Context $context) : void
|
||||
public function exportFunctions(): array
|
||||
{
|
||||
$context->pushFunction("form", [ $this, 'formClass' ]);
|
||||
return [
|
||||
"form" => [ $this, 'formClass' ],
|
||||
];
|
||||
}
|
||||
|
||||
public function formClass(FormInterface $form, ? FormContext $formContext = null) : FormHandler
|
||||
|
||||
@@ -13,7 +13,7 @@ class FormContext implements FormContextInterface
|
||||
|
||||
public bool $formExecuted = false;
|
||||
|
||||
public /*mixed*/ $formExecutionStatus = null;
|
||||
public mixed $formExecutionStatus = null;
|
||||
|
||||
public array $values = [];
|
||||
|
||||
@@ -86,7 +86,7 @@ class FormContext implements FormContextInterface
|
||||
|
||||
return $this->formSent = $valid;
|
||||
}
|
||||
|
||||
|
||||
public function __set($key, $value)
|
||||
{
|
||||
return $this->set($key, $value);
|
||||
|
||||
@@ -8,5 +8,5 @@ interface FormInterface
|
||||
|
||||
public function validate(FormContextInterface $context) : bool;
|
||||
|
||||
public function execute(FormContextInterface $context) /* : mixed */;
|
||||
public function execute(FormContextInterface $context);
|
||||
}
|
||||
@@ -7,9 +7,10 @@ use Picea\Extension\Extension,
|
||||
|
||||
use Picea\Compiler\Context;
|
||||
|
||||
use Picea\Extension\FunctionExtension;
|
||||
use Psr\Http\Message\ServerRequestInterface;
|
||||
|
||||
class Pagination implements Extension {
|
||||
class Pagination implements Extension, FunctionExtension {
|
||||
use ExtensionTrait;
|
||||
|
||||
public array $tokens;
|
||||
@@ -20,14 +21,16 @@ class Pagination implements Extension {
|
||||
|
||||
public function __construct(ServerRequestInterface $request, Context $context) {
|
||||
$this->request = $request;
|
||||
$this->register($context);
|
||||
}
|
||||
|
||||
public function parse(\Picea\Compiler\Context &$context, ?string $arguments, string $token) : string { }
|
||||
|
||||
public function register(Context $context) : void
|
||||
|
||||
public function exportFunctions(): array
|
||||
{
|
||||
$context->pushFunction("pagination", [ $this, 'paginationClass' ]);
|
||||
return [
|
||||
"pagination" => [ $this, 'paginationClass' ]
|
||||
];
|
||||
}
|
||||
|
||||
public function paginationClass(string $name, ?string $url = null, ?array $params = null) : PaginationHandler
|
||||
|
||||
@@ -41,7 +41,7 @@ class PaginationHandler {
|
||||
}
|
||||
|
||||
public function __toString() {
|
||||
return "hello world";
|
||||
return "";
|
||||
}
|
||||
|
||||
}
|
||||
Reference in new issue
Block a user