FWConfig
extends SimpleModel
in package
Uses
FWEdit, MakeGuard
A class implementing a RedBean model for Page beans
Tags
Table of Contents
- $editfields : array<, array<, bool>>
- add() : OODBBean
- Add a new FWConfig bean
- checkURL() : void
- Check for a URL or // URL or a local filename - return value or throw
- doupdate() : void
- Handle an update from the page updater
- edit() : array<, mixed>
- Handle an edit form for this fwconfig item
- guard() : string
- Return the CSRFGuard inputs for inclusion in a form;
- startEdit() : void
- Setup for an edit
- update() : void
- Function called when a page bean is updated - do error checking in here
- dofields() : array<, string>
- Handle editing of beans
Properties
$editfields
private
static array<, array<, bool>>
$editfields
= [
'value' => [TRUE, FALSE],
// [NOTEMPTY, CHECK/RADIO]
'integrity' => [FALSE, FALSE],
'crossorigin' => [FALSE, FALSE],
'defer' => [FALSE, TRUE],
'async' => [FALSE, TRUE],
'type' => [TRUE, FALSE],
]
Key is name of field and the array contains flags for checks
Tags
Methods
add()
Add a new FWConfig bean
public
static add(Context $context) : OODBBean
Parameters
- $context : Context
-
The context object
Tags
Return values
OODBBean —checkURL()
Check for a URL or // URL or a local filename - return value or throw
public
checkURL(string $type) : void
Parameters
- $type : string
-
For error message
Tags
Return values
void —doupdate()
Handle an update from the page updater
public
doupdate(object $cdata, string $base, bool $doit) : void
Parameters
- $cdata : object
-
Update values from the json updater
- $base : string
- $doit : bool
Return values
void —edit()
Handle an edit form for this fwconfig item
public
edit(Context $context) : array<, mixed>
Parameters
- $context : Context
-
The context object
Return values
array<, mixed> —[TRUE if error, [error messages]]
guard()
Return the CSRFGuard inputs for inclusion in a form;
public
guard() : string
Return values
string —startEdit()
Setup for an edit
public
startEdit(Context $context) : void
Parameters
- $context : Context
-
The context object
Tags
Return values
void —update()
Function called when a page bean is updated - do error checking in here
public
update() : void
Tags
Return values
void —dofields()
Handle editing of beans
private
dofields(AccessBase $fdt) : array<, string>
Parameters
- $fdt : AccessBase
-
The formdata object from the context