> > Utilizo: https://github.com/krolow/Attach > Pero no acabo deenteder muy bien el funccionamiento... el creador me dice > que se creea automaticamente un foreign_key > > Attach creates the relationship with Attachment dynamically, what this means, the type will be used to create one relation. E.g: In your case $user = $this->User->find('first'); You will have $user['AttachmentUser'] that has the info from attachments table... This name AttachmentUser is created based in the type of relation that you give in the $actsAs... Attach also provides one helper to display images: * https://github.com/krolow/Attach/blob/master/View/Helper/AttachHelper.php*<https://github.com/krolow/Attach/blob/master/View/Helper/AttachHelper.php> So in your controller you can add the helper $helpers = array('Attach.Attach'); In your view $this->Attach->image($user['AttachmentUser'], '*size*'); The *size* is in case you have generate thumbnails, you can pass as the second argument the thumbnail that you want to use. For example in the README of project it mentions about a "thumb" so it would be $this->Attach->image($user['AttachmentUser'], '*thumb*'); Si lo vas ha utilizar comentame como te ha ido....
-- Has recibido este mensaje porque estás suscrito al grupo "CakePHP-es" de Grupos de Google. Para anular la suscripción a este grupo y dejar de recibir sus correos electrónicos, envía un correo electrónico a [email protected]. Para publicar una entrada en este grupo, envía un correo electrónico a [email protected]. Visita este grupo en http://groups.google.com/group/cakephp-es?hl=es. Para obtener más opciones, visita https://groups.google.com/groups/opt_out.
