Full name in $title

Full name in $title

per Артём Сергеев -
Nombre de respostes: 3

Good afternoon. There is a code, it will imprint for generation <title>

public function review_page_title(int $page, bool $showall = false) : string {

if (!$showall && $this->get_num_pages() > 1) {

$a = new stdClass();

$a->name = $this->get_quiz_name();

$a->currentpage = $page + 1;

$a->totalpages = $this->get_num_pages();

$title = get_string('attemptreviewtitlepaged', 'quiz', $a);

} else {

$title = get_string('attemptreviewtitle','quiz', $this->get_quiz_name(),);

}

return $title;

How can I display the full name in the title? last name, first name and patronymic.



Mitjana de qualificacions: -
En resposta a Артём Сергеев

Re: Full name in $title

per Артём Сергеев -
En resposta a Артём Сергеев

Re: Full name in $title

per Dominique Palumbo -
Imatge Particularly helpful Moodlers Imatge Plugin developers
Hi,

maybe it's what you looking for ?

https://stackoverflow.com/questions/22572428/getting-users-information-from-moodle
"There is global object called $USER in moodle, this object contains all information about user, So where you want these information just access like,

global $USER; // <= don't forget to write this before to access
$USER->username;
$USER->firstname;
$USER->lastname;

edited Mar 22 '14 at 2:55
answered Mar 22 '14 at 2:44
Suman Bogati"