How to make website logo changer ?

i want to make site logo changer  using forms , but i dont know how to code the action

 

this is my form code:


$fields = [
    [
        '#type' => 'file',
        '#label' => 'Photo',
        '#help' => $upload_limit,
        'name' => 'headline_photo',
        
        
    ],
    
    
    [
        '#type' => 'text',
        'name' => 'headline_title',
        '#label' => "Headline",
        'value' => $site->headline_title,
    ],
    
  
    
    
  
];

foreach ($fields as $field) {
    echo elgg_view_field($field);
}

$footer = elgg_view_field([
    '#type' => 'submit',
    'value' => elgg_echo('save'),
]);
elgg_set_form_footer($footer);

 

 

 

 

please give me code that will save logo for my website ,

and tell me how to show it in the website , for example : $site->getLogo() or something else

 

my client is not programmer , so i want to make it easy for him to change the site logo if he want to change it in the future

Beginning Developers

Beginning Developers

This space is for newcomers, who wish to build a new plugin or to customize an existing one to their liking