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:
How does it work under 5.7? Thanks for your help.
Regards
Marcus
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
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:
Or saith against something?
regards
Marcus
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
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:
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:
Thanks for your help! :-)
<?php
$block = new Application\Block\BlockName\Controller();