Extend/Override core block controller in package
Permalink
Hey,
I need to override/extend a core block type controller in my package so I can extend its methods. My current use case is to use registerViewAssets() in my extended controller to require assets for a custom template provided in my package. Here's what I have so far in my controller.php located in packages\testpkg\blocks\image_slider\
I need to override/extend a core block type controller in my package so I can extend its methods. My current use case is to use registerViewAssets() in my extended controller to require assets for a custom template provided in my package. Here's what I have so far in my controller.php located in packages\testpkg\blocks\image_slider\
<?php namespace Concrete\Package\Testpkg\Block\ImageSlider; use Concrete\Block\ImageSlider\Controller as ImageSliderBlockController; // InheritedBlockController class Controller extends ImageSliderBlockController { public function registerViewAssets() { $this->requireAsset('bxslider'); // bxslider is an asset group registered in my package on_start() echo 'registerViewAssets() in package block override!'; // above requireAsset() doesnt include assets in page } }