本文整理汇总了PHP中Attachments::subtype方法的典型用法代码示例。如果您正苦于以下问题:PHP Attachments::subtype方法的具体用法?PHP Attachments::subtype怎么用?PHP Attachments::subtype使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Attachments
的用法示例。
在下文中一共展示了Attachments::subtype方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1:
<div class="span1"><?php
echo $attachments->image('thumbnail');
?>
</div>
<div class="span11">
<a target="_blank" href="<?php
echo $attachments->url();
?>
" title="Download"><i class="icon-download-alt"></i> <?php
echo $attachments->field('title');
?>
/ <?php
echo $attachments->filesize();
?>
(<?php
echo $attachments->subtype();
?>
)</a>
<?php
if ($attachments->field('caption') != "") {
?>
<p><?php
echo $attachments->field('caption');
?>
</p>
<?php
}
?>
</div>
</div>
<?php
示例2: get_attachments_array
function get_attachments_array($name, $srcSize = 'full')
{
$return = array();
$attachments = new Attachments($name);
if ($attachments->exist()) {
$i = 0;
while ($attachments->get()) {
$return[$i]['id'] = $attachments->id();
$return[$i]['type'] = $attachments->type();
$return[$i]['subtype'] = $attachments->subtype();
$return[$i]['url'] = $attachments->url();
$return[$i]['thumbnail'] = $attachments->image('thumbnail');
$return[$i]['srcfull'] = $attachments->src('full');
$return[$i]['src'] = $attachments->src($srcSize);
$return[$i]['filesize'] = $attachments->filesize();
$return[$i]['title'] = $attachments->field('title');
$return[$i]['caption'] = $attachments->field('caption');
$i++;
}
}
return $return;
}