基本上我有兩種方法寫的東西PHP和HTML模板風格偏好
第一:
<?php
echo link_to(
static_image_tag(
$object->getImageWebPath(),
array(
"alt" => $object->getTitle(),
"width" => "106",
"height" => "73",
"class" => 'aaa bbb'
)
),
url_for('route_name', $object),
array(
"class" => "aaa bbb", "title" => $object->getTitle())
);
?>
二:
<a href="<?php echo url_for('route_name', $object->getLink()); ?>" title="<?php echo $object->getTitle(); ?>" class="aaa bbb">
<img src="<?php echo map_to_static_domain($image->getWebPath()) . $image->getWebPath(); ?>" class="aaa bbb" alt="echo $image->getTitle()" "width" => "106", "height" => "73" />
</a>
現在一個 '百萬美元的問題',其中之一方式你們使用,甚至爲什麼...
謝謝。
第二種方法是少眼痛,誰是你的目標受衆? – ajreal 2010-11-18 10:30:15