public function get_forum_view_url_from_course_module_id(int $coursemoduleid, ?int $pageno = null,
            ?int $sortorder = null) : moodle_url {

        $url = new moodle_url('/mod/forum/view.php', [
            'id' => $coursemoduleid,
        ]);

        if (null !== $pageno) {
            $url->param('p', $pageno);
        }

        if (null !== $sortorder) {
            $url->param('o', $sortorder);
        }

        return $url;
    }
public function get_forum_view_url_from_course_module_id(int $coursemoduleid, ?int $pageno = null,
            ?int $sortorder = null) : moodle_url {

        $url = new moodle_url('/mod/forum/view.php', [
            'id' => $coursemoduleid,
        ]);

        if (null !== $pageno) {
            $url->param('p', $pageno);
        }

        if (null !== $sortorder) {
            $url->param('o', $sortorder);
        }

        return $url;
    }
public function get_forum_view_url_from_course_module_id ( int $ coursemoduleid , ? int $ pageno = null , ? int $ sortorder = null ) : moodle_url { $ url = new moodle_url ( '/mod/forum/view.php' , [ 'id' => $ coursemoduleid , ] ) ; if ( null !== $ pageno ) { $ url -> param ( 'p' , $ pageno ) ; } if ( null !== $ sortorder ) { $ url -> param ( 'o' , $ sortorder ) ; } return $ url ; }
Get the view forum url for the given course module id and optionally a page number.

@param int $coursemoduleid The course module id
@param int|null $pageno The page number
@param int|null $sortorder The sorting order
@return moodle_url
Get the view forum url for the given course module id and optionally a page number .