[Koha-devel] template system abuse

Pierrick LE GALL pierrick at koha-fr.org
Thu Apr 13 18:24:13 CEST 2006


Robert,

On Thu, 13 Apr 2006 10:03:09 -0500
"Robert Flach, Poet and Critic" <webmaster at allauthors.com> wrote:

> It's a bad idea to generate ANY HTML in the code.  Keep the
> presentation in the presentation layer (templates).  No matter how
> obvious or useful a particular choice may seem now, it will cause you
> heartache down the road. 

This remember a case were I didn't find any solution with template : N
levels nested lists.

<ul>
  <li>1
    <ul>
      <li>1.1
        <ul>
          <li>1.1.1</li>
          <li>1.1.2</li>
        </ul>
      </li>
      <li>1.2
        <ul>
          <li>1.2.1</li>
          <li>1.2.2</li>
        </ul>
      </li>
    </ul>
  </li>
  <li>2</li>
</ul>

You don't know in advance the number of level. It can be 2 or 10. Is
that feasible in a template engine? (not with simple template engine in
my opinion). Personnaly, I resigned and coded it into PHP and gave an
HTML string to the template. I'm not sure this case happens in Koha,
but I think it's to easy to say "no HTML in script".

Robert, you're opinion? (a solution for my problem?)

-- 
Pierrick LE GALL
INEO media system





More information about the Koha-devel mailing list