2
0
mirror of https://github.com/opnsense/docs synced 2024-10-30 21:20:20 +00:00

development/frontend/models - add volatile option. closes https://github.com/opnsense/docs/issues/542

This commit is contained in:
Ad Schellevis 2024-03-17 19:02:18 +01:00
parent 9e3010b482
commit 2795d75201

View File

@ -2,6 +2,8 @@
Designing the model Designing the model
------------------- -------------------
.. contents:: Index
Creating models for OPNsense is divided into two separate blocks: Creating models for OPNsense is divided into two separate blocks:
#. A PHP class describing the actions on our data (also acts as a #. A PHP class describing the actions on our data (also acts as a
@ -116,6 +118,22 @@ their own namespace at *OPNsense\\Base\\FieldTypes* deriving from *BaseField*.
exists) exists)
volatile fields
.........................................
In some cases it can be practical to define fields which act as standard fields, but will not be persisted
in the configuration. Examples of this are fields used to generate other type of content, such as a certificate
or fields that reflect data stored elsewhere.
To make a field volatile, just add the tag :code:`volatile="true"` in the xml clause, for example:
::
<serial type="IntegerField" volatile="true"/>
------------------------------------
Special model types Special model types
------------------------------------ ------------------------------------