【发布时间】:2011-12-23 21:12:12
【问题描述】:
我尝试使用灯箱,我按照link 中的所有步骤操作,但代码中存在问题
<a href="images/image-1.jpg" rel="lightbox">
<img src="images/thumb-1.jpg" width="100" height="40" alt="" />
</a>
我把 images 文件夹放在 webroot 中
C:\wamp\www\tet\app\webroot\img\images
我用上面的代码代替
$thumb = $this->Html->image('images/thumb-1.jpg');
$full = $this->Html->image('/images/image-1.jpg', array('rel' => 'lightbox'));
echo $this->Html->link($thumb,$full, array('escape' => false));
但我仍然看到这个错误
Missing Method in ImagesController
Error: The action <img src=" is not defined in controller ImagesController
Error: Create ImagesController::<img src="() in file: app\controllers\images_controller.php.
<?php
class ImagesController extends AppController {
var $name = 'Images';
function <img src="() {
}
}
?>
请帮忙
【问题讨论】:
标签: cakephp cakephp-1.3