Changing the signature to static
namespace Drupal\livequotes\Controller;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Controller\ControllerBase;
/**
* Controller routines for livequotes routes.
*/
class LivequotesController extends ControllerBase{
protected $entity;
public static function create(ContainerInterfaceContainer $container) {
return new static($container->get('entity'));
}
public function __construct(EntityInterface $em) {
$this->entity = $em;
}
/**
* Re-render a specific block (yeah if we do something it should be generic).
*/
public function livequotesShowBlock()
{
$block_id = "livequotes_content";
$block = $this->entity->getStorage('block')->load($block_id);
return $this->entity->getViewBuilder('block')->view($block);
}
}