我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

将类添加到PHP echo JHtml

I'm trying to add a class to the image below:

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

I tried the solution on this topic but it didn't work.

The result I'm trying to achieve is to add class="scale" to the <img> tag.

You should try:

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

That should work.

近期文章

  • Moodle经理的观点选项
  • $ total_paid获取价值Prestashop
  • php,从$ _POST搜索字符串的txt并覆盖包含该变量的行
  • 生成Jooma! Java中的密码
  • 无法在linux服务器上传文件
  • PHP - 从文件指针中删除行
  • PHP。 Mysql - 方法不更新mysql行
  • 如何从服务器销毁用户会话
  • 将动态$ _POST数据转换为for循环
  • PHP:使用表单值填充数组
  • 在缩略图短代码中添加帖子ID请求
  • 谷歌可视化 - 点击事件调用其他谷歌图表
  • php - Chrome在首次加载时未检测到UTF-8
  • 如何在php页面中以html格式显示textarea
  • 动态地将值附加到文本框中
  • 管理面板:输入文本,发布到数据库,博客样式
  • 如何在Wordpress中存储与原始帖子相关的图像?
  • PHP执行firefox加载网页? 例如openlink.php?link = blah.com
  • 每行单独用于语言和翻译
  • 编码到base64后解压缩文件并在另一个应用程序中解码

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华