Forumlar / Cotonti / Core Labs / Archive / Logic blocks for xtemplate

medar
#9660 2009-03-10 17:40
I don't understand why all praying on "Logic should stay away from presentation"

Simple example.
There in field users_photo with url of picture. It need display in user page.

<img src="{USERS_PHOTO}" /> is bad solution - if users_photo is empty IE will display error empty image.
Admin must write plugin for tag {SHOW_USERS_PHOTO}
Admin must
- know PHP
- know Cotonti plugin system

But now admin write in tpl:
<!-- IF {USERS_PHOTO}!="" -->
<img src="{USERS_PHOTO}" />
<!-- ENDIF -->

And no problem!
Logic blocks - for similar simple solutions. For complex need to write plugin fo course.

BTW, request on this feature i was get from skinmaker, not programmer.
Orkan:
One would say "If you dont like it, then dont use it" but what if an artist makes changes in someone else work an there are plenty of "logic" inside?
If artist understand english, he will understand logic blocks. :)
rangjungyeshe.ru
Bu gönderi medar tarafından düzenlendi (2009-03-10 17:51, 16 yıllar önce)