Loader::helper('concrete/interface');

Permalink
In older blocks we could use the interface helper, like the Add Image button in the old slideshow block did.

$ah = Loader::helper('concrete/interface');
$ah->button_js(t('Add Image'), 'SlideshowBlock.chooseImg()', 'left')


This doesn't work anymore in 5.7. You get an error with the Loader::helper('concrete/interface') it says "Class helper/concrete/interface does not exist". Then with just the button_js line the form does not load at all.

Is that interface helper gone in 5.7 or what needs to be done to make it work?

thanks

pvernaglia
 
exchangecore replied on at Permalink Reply
exchangecore
I believe what you are looking for now is:

$ah = Loader::helper('concrete/ui');
Shotster replied on at Permalink Reply
Shotster
Or if you want to avoid calls to the [now deprecated] Loader class...

$ah = Core::make('helper/concrete/ui');

That said, the Loader class is still used in various places throughout the core, so I guess there's no big rush to adopt the new approach, but it should make your code a bit more future-proof.

-Steve
Arequal replied on at Permalink Reply
Arequal
It worked!
zianadir replied on at Permalink Reply 3 Attachments
it working not working on me
it errors on js

ReferenceError: ccm_launchFileManager is not defined