【发布时间】:2014-06-07 10:52:52
【问题描述】:
我一直在尝试在 joomla 中使用 imagecreatefrompng 函数。
我在 components/mycomponent/views/imgview/tmpl/default.php 中使用该函数
我必须将图像 url 管理员/组件/mycomponent/images/img.png 传递给它。
我尝试了很多方法。但这些都不起作用。是否有任何特定方法可以将 url 传递给该函数。 IE。我应该把它作为
$img = imagecreatefrompng('administrator/components/mycomponent/images/img.png');
或
$img = imagecreatefrompng('http://localhost/joomla/administrator/components/mycomponent/images/img.png');
或
$img = imagecreatefrompng('/var/www/joomla/administrator/components/mycomponent/images/img.png');
任何帮助将不胜感激。
【问题讨论】:
-
您肯定希望使用路径,而不是 URL。您能否具体说明您在尝试使用其中一种调用时收到的任何错误?
-
添加路径 $config 属性而不是硬编码。
-
@mario:按照你说的尝试。
-
@Elin:我最终将不得不添加配置路径。但现在对其进行硬编码以检查它现在是否有效......
标签: php url joomla path imagecreatefrompng