title: Where put displaying tree logic?
body: <p>I have a function which builds category tree:</p>
  
  <pre><code>public static function buildSelectTree($tree, $step = 0) {
      $result = '';
  
      foreach ($tree as $element) {
          $result .= "&lt;option&gt;";
          $result .= str_repeat('--', $step) . ' ' . $element-&gt;name;
          $result .= '&lt;/option&gt;';
  
          if ($element-&gt;children) {
              $result .= self::buildSelectTree($element-&gt;children, $step + 1);
          }
      }
  
      return $result;
  }
  </code></pre>
  
  <p>Is it okay to put it in a model? Or I should put it somewhere else? I don't like the idea to work with html inside a model </p>