Load the controller of another block in custom block controller

Permalink
Hi!
In one of my blocks I would like to load the controller of another block, so far I have done it at 5.6 that:
Loader::block('foo_bar_bla');
$fbb = new FooBarBlaBlockController();


How does it work under 5.7? Thanks for your help.
Regards
Marcus

 
A3020 replied on at Permalink Reply
A3020
E.g.

<?php
$block = new Application\Block\BlockName\Controller();
marcusm replied on at Permalink Reply
Hi akodde

Thanks a lot, but i get an error "Class Concrete\Package\BlaBla\Block\AbcBlock\Application\Block\FooBarBla\Controller not found".

I just can find out how it works:
$bt = BlockType::getByHandle('foo_bar_bla');
$bt->controller->anyMethod();


Or saith against something?

regards
Marcus
A3020 replied on at Permalink Reply
A3020
Then use \Application\Block\Foo\Controller
At least, if the block is not part of a package. Otherwise, use the
package namespace.

Op Vr dec 11 2015, om 12:52 schreef concrete5 Community:
marcusm replied on at Permalink Reply
Thanks for your help! :-)