[luci] charset

Jo-Philipp Wich xm at subsignal.org
Tue Apr 6 23:18:18 CEST 2010


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi.

Can you provide some more context?
If you're working with cbi models, it is probably best to override the
formvalue() function of the corresponding field:


- -- >8 --

local function custom_decode(val)
	-- do something with value
	return val
end


m = Map("foo", "Foobar")
s = m:section(TypedSection, "baz", "Blubb")

field = s:option(Value, "yadda", "Whatever")

function field.formvalue(...)
	local value = Value.formvalue(...)
	return value and custom_decode(value)
end


- -- 8< --



~ JoW
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAku7pRkACgkQdputYINPTPONBwCgiurR6kO1MBXtd/fwETVcApV8
JUsAoIPpM4tb8/ugIaAwTvH6loP5a8c0
=ODO0
-----END PGP SIGNATURE-----


More information about the luci mailing list