Hello,
I'm trying to get something like this to work for displaying an image:
In the view 'items/index/' I have,
<td><img src="/images/display/<?php echo $item['Item']['id'] ?>" /></td>
Which is supposed to call this action in an images controller:
function display($id) {
$image = $this->Image->find($conditions = "item_id = $id");
header('Content-type: ' . $image['Image']['image_type']);
header('Content-length: ' . $image['Image']['image_size']);
echo $image['Image']['image_data'];
//exit();
}
I'm trying this because I've seen php scripts which do something like this:
<img src="view.php&id=1 /> calling view.php instead of calling a controller
action.
Can anyone put me on the right track with this?
Also, thanks in advance to all who would advise, "You really should put
those images on the file system." :-)
Thanks,
Dan J.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/cake-php
-~----------~----~----~----~------~----~------~--~---