Block link list not working

Block link list not working

by Robert Bryan -
Number of replies: 1

Why is it when I click on the link in my list block, it doesn't take me to the page that I have connected to the link.

CODE

    $this->content->items[] = html_writer::tag('a', 'School', array(href=>'school.php'));

    $this->content->items[] = html_writer::tag('a', 'Teacher', array(href=>'teacher.php'));

    $this->content->items[] = html_writer::tag('a', 'Pupils', array(href=>'pupil.php'));

This is the message I get instead

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.


Can somone explain to me what I am doing wrong, and how to fix it please?

Thanks

Rob


Average of ratings: -
In reply to Robert Bryan

Re: Block link list not working

by Richard Oelmann -
Picture of Core developers Picture of Plugin developers Picture of Testers

Look in the URL bar to see what address it is taking you to. You probably need to adjust the href to ensure its pointing to the correct folder as well, or use

new moodle_url('/your/path/to/file.php')