Answer the question
In order to leave comments, you need to log in
How to implement the output of objects from a function?
How can I get this code out of a function? I wrote echo everywhere in the function, shoved it into the array, nothing helped
$PAGE->set_pagelayout('report');
$PAGE->set_url('/blocks/studentcabinet/view_debts.php');
$PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
$PAGE->set_title(get_string('view_debts','block_studentcabinet'));
$PAGE->navigation->add(get_string('view_debts','block_studentcabinet'), new moodle_url('/blocks/studentcabinet/view_debts.php'), navigation_node::TYPE_CONTAINER);
function public_page($nameLinkPage) {
echo $PAGE->set_pagelayout('report');
echo $PAGE->set_url('/blocks/studentcabinet/'. $nameLinkPage. '.php');
echo $PAGE->set_context(get_context_instance(CONTEXT_SYSTEM));
echo $PAGE->set_title(get_string($nameLinkPage,'block_studentcabinet'));
echo $PAGE->navigation->add(get_string($nameLinkPage,'block_studentcabinet'), new moodle_url('/blocks/studentcabinet/'. $nameLinkPage), navigation_node::TYPE_CONTAINER);
}
public_page('view_archive');//настройка страницы
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question