I need some help intergrating font awesome icons into my code. I have realised that if I do a simple call like:
echo html_writer::tag('i', get_string('groupmembers', groupwork), array( 'class' => 'fa fa-users fa-2x')); echo html_writer::tag('p'); $students_in_groups = group_membersdata($groupid); foreach ($students_in_groups as $students_in_group) { $count_of_posts = countstudentposts($discussionid, $students_in_group->id); echo fullname($students_in_group) . ': (' . $count_of_posts . ' contributions)<br />'; }I get the desired results, as shown in the screenshot below. But now I want to hyperlink the icon and the text using the same html_writer functionality, and I'm failing to get the desired result.
My code is below. Please correct me where I'm getting things wrong:
echo $OUTPUT->box(html_writer::link(new moodle_url($templatefile_url), $file->get_filename()), "fa fa-download fa-3x", array('class' => 'fa fa-download'));
I'm just getting the file name with the font awesome icon, but without the hyperlink.