Search code examples
cakephpcakephp-3.0cakedc

how to use logged in user image in Cakephp with Cakedc plugin


how to check the image of user in cakephp 3.0 with cakedc plugin. There are two tables one for users and other for social account details. I want to how to do i fetch images for normal user and other who use login with facebook


Solution

  • There are many plugins available to upload images and process them (crop, resize etc) in CakePHP, check this list https://github.com/FriendsOfCake/awesome-cakephp#imagery and https://github.com/FriendsOfCake/awesome-cakephp#files. Then you'll need to extend the CakeDC Users Plugin to attach the upload related behavior, follow the documentation to extend the Users Table here https://github.com/CakeDC/users/blob/master/Docs/Documentation/Extending-the-Plugin.md#extending-the-model-tableentity

    Note this will depend a lot on the upload plugin selected, but most of them will provide a behavior you'll need to attach to the Users Table.

    Then override the users edit/add templates to add the required file fields for the avatar image upload.