{Şerit} etiketleri bütün Smarty şablonları sarma ile yanlış bir şey mi?

0 Cevap php

I want to keep my templates tidy and nicely intented but would like to deliver only very compact HTML to the browser.
Missing a better idea, I was wondering if there is something wrong with wrapping whole Smarty templates in {strip} tags like so?

{strip}
        <div class="albums">
            <h2>Alle Foto-Alben</h2>

            <ul class="photos clearfix">
                {foreach $albums as $album}
                    {if $album->publishedPhotos|count > 0}
                    <li>
                        <div>
                            <a href="album.php?id={$album->id}">
                                <img src="{$album->titlepic->thumb}" alt="{$album->titlepic->title}" />
                                <span class="title">{$album->title}</span>
                                <span class="counter">{$album->publishedPhotos|count} Foto{if $album->publishedPhotos|count != 1}s{/if}</span>
                            </a>
                        </div>
                    </li>
                    {/if}
                {/foreach}
            </ul>
        </div>
{/strip}

It smells a bit unprofessional to me but I could not come up with something better.
One downside definitely is that you have to wrap every single one of your templates in those tags.

Ben düzeltilmesi için mutluyum ve teslim kod kompakt tutarak farklı yaklaşımları duymak isterim.

0 Cevap