I've been toying with this one for a while now and I'm not really getting
anywhere.
I'm trying to display a photo stored in db as type "blob". With conventional
PHP I would normally store the photo with type "binary" and never had any
issues ... Blob is not going so well.
I figure the problem has something to do with content type but MVC is
confusing me a bit when it comes to headers or media views. It seems
straightforward enough but I think I'm going about the wrong way (I'm not
using media view or headers at this point).
In my Users Model I set up a $hasMany assoc.
var $hasMany = array(
'Photo' => array(
'className' => 'Photo',
'foreignKey' => 'user_id',
'conditions' => array('Photo.profile' => 1, 'Photo.private'
=> 0),
'limit' => '1',
'dependent'=> true
)
);
Rendering the photo is the problem.
> View
$html->tag('img', array(
'src' => $userInfo['Photo'][0]['file']
)
)
the "file" part of the array is empty:
[Photo] => Array
(
[0] => Array
(
[file] =>
[user_id] => 1
)
)
I tried a lot of different things but nothing worked the way I want. What is
the proper way to go about this?
- Ed
Check out the new CakePHP Questions site http://cakeqs.org and help others with
their CakePHP related questions.
You received this message because you are subscribed to the Google Groups
"CakePHP" 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?hl=en