I'm trying to output the full course name using html_writer.
Here is my code:
$coursename = format_string($course->fullname);
1. $output .= html_writer::div($coursename, array('class'=>'coursenametitle'));
-> This one will show error Warning: htmlspecialchars() expects parameter 1 to be string, array given in C:\wamp\www\lib\weblib.php on line
2. $output .= "<div class='coursenametitle'>".$coursename."</div>";
-> This one is fine, however I am not following the moodle coding convention.