我正在开发一个系统,用户最多可以上传四张照片。如果用户不上传照片,我希望将显示以下文本:“空”。
我已经准备了下面的代码,但是我没有管理:/问题是当上传图像时它仍然打印“空”并且上传的图像没有显示。
<?php if (file_exists('../files/collection/photo2/' .$collection['Collection']['photo_dir2'] . '/thumb_' . $collection['Collection']['photo2']))
{
echo $this->Html->image('../files/collection/photo2/' . $collection['Collection']['photo_dir2'] . '/thumb_' . $collection['Collection']['photo2']);}
else
{
echo ('empty');
}
?>
感谢您的指导和帮助:)