init with kirby, vue and pagedjs interactive
This commit is contained in:
commit
dc0ae26464
968 changed files with 211706 additions and 0 deletions
34
public/kirby/config/sections/fields.php
Normal file
34
public/kirby/config/sections/fields.php
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
use Kirby\Form\Form;
|
||||
|
||||
return [
|
||||
'props' => [
|
||||
'fields' => function (array $fields = []) {
|
||||
return $fields;
|
||||
}
|
||||
],
|
||||
'computed' => [
|
||||
'form' => function () {
|
||||
return new Form(
|
||||
fields: $this->fields,
|
||||
model: $this->model,
|
||||
language: 'current'
|
||||
);
|
||||
},
|
||||
'fields' => function () {
|
||||
return $this->form->fields()->toProps();
|
||||
}
|
||||
],
|
||||
'methods' => [
|
||||
'errors' => function () {
|
||||
$this->form->fill($this->model->content('current')->toArray());
|
||||
return $this->form->errors();
|
||||
}
|
||||
],
|
||||
'toArray' => function () {
|
||||
return [
|
||||
'fields' => $this->fields,
|
||||
];
|
||||
}
|
||||
];
|
||||
Loading…
Add table
Add a link
Reference in a new issue