Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何在 CakePHP 中生成图像?我想制作一个戒烟网站,并且我希望能够生成一张图像,显示他们没有吸过“多少包”和“多少支香烟”。
谢谢
将图像复制到app\webroot\img目录
app\webroot\img
例如:假设cigarette.png文件在app\webroot\img目录中。您可以按如下方式在视图文件中渲染该图像。 然后在视图文件中你可以添加以下代码来显示图像。 <?php echo $this->Html->image('cigarette.png'); ?>
cigarette.png
<?php echo $this->Html->image('cigarette.png'); ?>
如果您想多次显示此图像,请根据需要复制并粘贴它。