If some people come here and need to do the same thing, I did it like that:
href="<?php echo $CFG->wwwroot;?>/course/view.php?id=<?php echo $this->page->course->id ?>"
PS: Sorry if my language was offensive somehow, I see that you edited my previous message