How to find a URL for a file

Re: How to find a URL for a file

by Mark Johnson -
Number of replies: 0
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

You can just build it up from the data you've got:

CONCAT('/course/view.php?id=', co.id, '#section-', cm.section) in SQL or

new moodle_url('/course/view.php', ['id' => $record->id], 'section-' . $record->section); in PHP