Menu

#370 Add Description as parameter to XoopsFormElement constructor

XOOPS_2.6
open
MusS
Core (214)
5
2012-09-25
2012-04-01
No

Currently, in order to add Description to form element we have to use three lines:
$lang_code = new XoopsFormText(_AM_XLANG_CODE, 'lang_charset', 50, 255, $lang_code);
$lang_code->setDescription(_AM_XLANG_CODE_DESC);
$sform->addElement($lang_code, true);

instead of taking advantage of:

$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, 'lang_code', 50, 255, $lang_code), true);

we should be able to expand it by adding _AM_XLANG_CODE_DESC to the constructor as follow:

$sform->addElement(new XoopsFormText(_AM_XLANG_CODE, _AM_XLANG_CODE_DESC, 'lang_code', 50, 255, $lang_code), true);

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.