03-17-2009, 03:56 PM
|
#12 (permalink)
|
|
The Gregarious
Join Date: Feb 2009
Location: New York
Posts: 645
Thanks: 64
|
Quote:
Originally Posted by triumvirat
Use strict PHP as template engine:
PHP Code:
<? foreach($user_data as $row):?>
<tr class="center color_hover">
<td><?=$row["id"]?></td>
<td><a href="?id=<?=$row["id"]?>"><?=$row["user_name"]?></a></td>
<td><a href="/admin/user/?id_country=<?=$row['user_country']?>"><?=$row['country_name']?></a>, <a href="/admin/user/?id_region=<?=$row['user_region']?>"><?=$row['region_name']?></a>, <a href="/admin/user/?id_city=<?=$row['user_city']?>"><?=$row['city_name']?></a></td>
<td>
<? if($row["user_icq"]): ?>
<img src="http://web.icq.com/whitepages/online?icq=<?=$row["user_icq"]?>&img=5" alt="" />
<? else: ?>
<img src="<?=$http_images_system_icons?>icq_empty.png" alt="" />
<? endif; ?>
</td>
<td>
<? if($row["user_url"]): ?>
<a onclick="return open_window(this.href)" href="<?=$row["user_url"]?>"><img src="<?=$http_images_system_icons?>homepage_noempty.png" alt="" /></a>
<? else: ?>
<img src="<?=$http_images_system_icons?>homepage_empty.png" alt="" />
<? endif; ?>
</td>
...............
Smarty - the PHP writеten in PHP. IMHO.
|
That is an interesting way to use IF ELSE statement, I've never seen it done that way. Glad to see that it can be done in other ways without always using the "BRACKETS"....
Quote:
Originally Posted by delayedinsanity
Might I offer up that it's the same reason people pay $60+ for a t-shirt and $100+ for a pair of jeans that have a stupid label on them? When the material is worth less than a fraction of that? It's popular. I've hardly picked up a PHP book that didn't plug it.
It strikes me as redundant, personally. It's similar to my dislike of most frameworks, why use thirty pounds of product when one pound is what you need? I would say no, you don't need to learn Smarty unless you have an employer that orders you to.
|
I agree, this seems to be the same thoughts on a lot of people who look into frameworks and templating engines.
I personally will go ahead and try to learn probably Zend Framework because what I am seeing out there are employers looking for individuals with experience in Zend/CakePHP...and Smarty for templating.
I can't learn them all so I figured I'll roll the dice with Zend.....hopefully it pays off...
|
|
|
|