【问题标题】:How to display vendor image file in cakephp .ctp file如何在 cakephp .ctp 文件中显示供应商图像文件
【发布时间】:2012-12-01 10:36:30
【问题描述】:

我创建了组件secureimage验证码,现在我想显示“vendor files audio/refresh.png”文件,该文件位于vendor/secureimage/images/refresh.png和vendor/secureimage/下图像/audio_icon.png

代码-----------

<object type="application/x-shockwave-flash" data="/adminpanel_login/captcha/securimage_play.swf?bgcol=#ffffff&amp;icon_file=/adminpanel_login/captcha/audio_icon.png&amp;audio_file=<?php echo $captcha_hear;?>" height="32" width="32">
     <param name="movie" value="/adminpanel_login/captcha/securimage_play.swf?bgcol=#ffffff&amp;icon_file=/adminpanel_login/captcha/audio_icon.png&amp;audio_file=<?php echo $captcha_hear;?>" />
</object> 

<a tabindex="-1" style="border-style: none;" href="#" title="Refresh Image" onclick="document.getElementById('captcha').src ='<?php echo $this->webroot;?>admins/securimage/' + Math.random(); this.blur(); return false"><img src="<?php //echo $captcha_image_refresh;?>/adminpanel_login/captcha/refresh.png" alt="Reload Image" height="32" width="32" onclick="this.blur()" align="bottom" border="0" /></a>   

【问题讨论】:

    标签: cakephp components captcha vendor


    【解决方案1】:

    您应该将图像放在 webroot 中,这样它们可以直接由您的网络服务器而不是 php 提供。

    您可以通过将图像从 vendors 符号链接到 webroot/img 来做到这一点

    【讨论】:

    • 我已经这样做了。我正在寻找直接在 .ctp 中使用供应商文件的方法。
    猜你喜欢
    • 2014-12-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-09-30
    • 1970-01-01
    • 1970-01-01
    • 2017-06-11
    • 1970-01-01
    相关资源
    最近更新 更多