I can not render my custom block within my custom template,
Point is on newsletter subscriber, I extend newsletter_subscriber_form.xml
,
Add container within my block but it says that template is invalid,
When is added in existing reference block nothing happened,
When I put a template in an existing block of this layout
(e.q. Magento\Backend\Block\Widget\Grid\Massaction)
It renders but I need my custom functionality.
Layout block
<container name="content">
<block class="Pool\Module\Block\Adminhtml\Subscriber\Button" name="button" template="Pool_Module:button.phtml" />
</container>
path of template is on Pool/Module/view/adminhtml/templates/button.phtml
Block
<?php
namespace Pool\Module\Block\Adminhtml\Subscriber;
use Magento\Framework\View\Element\Template;
class Button extends Template
{
public function __construct(Template\Context $context, array $data = [])
{
parent::__construct($context, $data);
}
public function addNewSubscriber()
{
var_dump('hi');
}
}