【发布时间】:2015-11-18 06:22:17
【问题描述】:
我只是想检查图像是否存在,我可以使用 PHP 来完成。例如:-
$file = WWW_ROOT .'uploads' . DS . 'employee' . DS .'_'.check.jpg;
$file_exists = file_exists($file);
它对我来说很好用。但我也试过像这样使用elementExists:-
if($this->elementExists("../".$employees->front_image))
{
echo $this->Html->image("../".$employees->front_image); // image output fine without condition.
}
// Here $employees->front_image = uploads/employee/employeename.jpg
此检查不起作用。我怎样才能在 CakePHP 中做到这一点?
【问题讨论】:
标签: cakephp cakephp-3.0