title: Moodle get categories
body: <p>I'm trying to create a theme that on the homepage it will display the categories and courses, I was able to get the courses with <strong>get_courses()</strong> function like that:</p>
  
  <pre><code>&lt;?php $courses = get_courses(); ?&gt;
  
  &lt;?php foreach ($courses as $key =&gt; $value) { ?&gt;    
      &lt;a href="course/view.php?id=&lt;?php echo $key; ?&gt;"&gt;
          &lt;h2 class="title"&gt;&lt;?php echo $courses[$key]-&gt;fullname; ?&gt;&lt;/h2&gt;            
      &lt;/a&gt;
      &lt;p class="summary"&gt;&lt;?php echo $courses[$key]-&gt;summary; ?&gt;&lt;/p&gt; 
      &lt;p class="category"&gt;&lt;?php echo $courses[$key]-&gt;category; ?&gt;&lt;/p&gt;       
  &lt;?php } ?&gt;
  </code></pre>
  
  <p>Now I'm trying to get the categories,<br/>
  the only thing I was able to get is the category ID with [$key]->category</p>
  
  <p>How Can I get the category name and display it?</p>