User Tools

Site Tools


t1.11_adding_a_profile_picture_file

Adding a profile picture

We now want to be able to add profile pictures of the employees. This is also one of the really easy ones.

We once again extends the Employee object, by adding to the buildStructure() function:

  ...
  'profile_pic' => array(
    'label' => 'Profile picture',
    'fieldtype' => self::FIELDTYPE_IMAGE,
    'folder' => 'profile_pictures'
  ),
  ...

And remember to call $instance→initializeDatabase() afterwards.

That's it. And if you want to know where the file ends up, it ends up in the storage folder configured in tutorial step 2 in a subfolder corresponding to the instance ID and another subfolder named profile_pictures.

t1.11_adding_a_profile_picture_file.txt · Last modified: 2021/03/11 20:20 by sahl

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki