Skip to content
Commit 4cca96ef authored by Jo-Philipp Wich's avatar Jo-Philipp Wich
Browse files

luci-base: support option aliases in luci.cbi



AbstractValue descendants may now specify a new optional property `alias`
which refers to a uci option to read/write/remove that differs from the
option name itself.

This is mainly useful for widgets that are toggled based on dependencies,
e.g. for alternating between SingleValue and MultiValue, but which are
intented to write into the same uci option.

Such a setup was previously possible already by overriding the .cfgvalue(),
.write() and .remove() callbacks with custom implementations, but that
required a lot of boiler plate code and was rather fragile.

With the `alias` property, CBI now takes care of the details and tracks
aliased fields within a section accordingly.

Signed-off-by: default avatarJo-Philipp Wich <jo@mein.io>
parent 501f1a90
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment