Posted by freenotes on October 19, 2011 at 12:39pm
[field_image] => Array
(
[und] => Array
(
[0] => Array
(
[fid] => 13
[alt] =>
[title] =>
[uid] => 1
[filename] => 123.jpg
[uri] => public://123.jpg
[filemime] => image/jpeg
[filesize] => 96251
[status] => 1
[timestamp] => 1319025940
[type] => image
[rdf_mapping] => Array
(
)
)
)
)
Em print_r($content);
ra đc trên, giờ em muốn lấy value filename thì pải làm sao ạ. em cảm ơn rất nhiều, mong hồi âm sớm.

Comments
Cách đơn giản nhất là
Cách đơn giản nhất là $content['field_image']['und'][0]['filename'] :) . Còn cách khác thì em coi thử sao nhé.
MinhVN
Free Notes
Ok, Cảm ơn rất nhiều. cái này cho nó đơn giản.
Y: Free.Notes
F: tuansieu
T: tuansieu
E: free.notes@yahoo.com
W: freenotes.us - drupalvn.org
P: 0936 111 039
Free Notes
<?phpif ($node->field_image['und'][0]['uri']):
?>
<?php" if alt="print image_style_url('body_images', $node->field_image['und'][0]['uri']);
?>
<?phpprint $node->field_image['und'][0]['alt'];
?>
<?phpendif;
?>
+++++++++++++++++++
Như bạn chỉ ở trên, ko dùng đc, bị lỗi, bạn dùng cái này nhé. Mình chưa thử, nhưng chắc là đc, vì sẽ hợp lý hơn.
Y: Free.Notes
F: tuansieu
T: tuansieu
E: free.notes@yahoo.com
W: freenotes.us - drupalvn.org
P: 0936 111 039
haha dùng "und" không được
haha dùng "und" không được đâu phải thay bằng "#items"
Website cập nhật link sopcast, xem online bóng đá - Website chia sẻ phần mềm, mã nguồn, website templates - Website Anime Vietsub
Dùng cách này
Dùng cách này đi:
<?php
$images = field_get_items('node', $node, 'field_image');
foreach($images as $image) {
print image_style_url('body_images', $image['uri']);
}
?>
API: http://api.drupal.org/api/drupal/modules--field--field.module/function/f...
--
Best regards,
Sang, Lê Thanh
Tel: +84 988079498
Email: me[at]sanglt.com
WWW: www.sanglt.com