5.7 - Image picker - How to?

Permalink
I need to implement an image picker. In 5.6.x I did that:

$al = Loader::helper ( 'concrete/asset_library' );
$bf2 = File::getByID($fID); 
echo $al->image('logo_image', 'logo_image', t('Choose Image'), $bf2);


How do I do it now? The asset library seems to be still loading even though it's legacy, but the image picker doesn't really show up and I can't find any documentation about it.

 
hutman replied on at Permalink Best Answer Reply
hutman
I have code that is nearly the same as yours that is working in 5.7, here is what I have

$al = Loader::helper('concrete/asset_library');
if(isset($fID) && intval($fID) > 0){
   $if = File::getByID($fID);
   echo $al->image('ccm-b-file', 'fID', t('Choose'), $if);
} else {
   echo $al->image('ccm-b-file', 'fID', t('Choose'));
}
Kiesel replied on at Permalink Reply
Thank you, it works now!