get_string() strange output

get_string() strange output

by Davide Lista -
Number of replies: 1

Hi,

I've added 3 lines in "change_password_form.php" because I have to insert a checkbox in the page, this is the code:

$mform->addElement('checkbox', 'checkbox', get_string('I accept policy'));

$mform->addRule('checkbox', get_string('required'), 'required', null, 'client');

$mform->setType('checkbox', PARAM_INT);


But on the page the string is printed between four square brackets and I don't know why.




Average of ratings: -
In reply to Davide Lista

Re: get_string() strange output

by A. Obeid -

Hi

simple way:

change 

$mform->addElement('checkbox', 'checkbox', get_string('I accept policy'));

to 

$mform->addElement('checkbox', 'checkbox', 'I accept policy'); 

Normal way is:

 add your string variable to language file