【问题标题】:Add class to PHP echo JHtml将类添加到 PHP echo Html
【发布时间】:2015-09-17 18:07:38
【问题描述】:

我正在尝试向下图中添加一个类:

<?php 
   echo JHtml::_('image', 
                 $item->thumbnail,
                 $image_width, 
                 null, 
                 $this->escape($item->title)); 
?>

我在this topic 上尝试了解决方案,但没有成功。

我想要达到的结果是将class="scale" 添加到&lt;img&gt; 标记中。

【问题讨论】:

    标签: php html image class joomla


    【解决方案1】:

    你应该试试:

    JHtml::_('image', $item->thumbnail, escape($item->title), array('class'=>'scale', 'width'=> $image_width));
    

    应该可以。

    【讨论】:

      猜你喜欢
      • 2012-08-04
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2011-04-26
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多