Код: Выделить всё
<?php
namespace webliberty\credit\event;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
class listener implements EventSubscriberInterface
{
protected $template;
public function __construct(\phpbb\template\template $template)
{
$this->template = $template;
}
static public function getSubscribedEvents()
{
return array(
'core.page_footer' => 'page_footer'
);
}
public function page_footer($event)
{
$this->template->assign_vars(array(
'CREDIT_LINE' => '<a rel="nofollow" target="_blank" href="https://www.phpbb.com/">phpBB</a>® Forum Software © phpBB Limited'
));
}
}
?>
Код: Выделить всё
// A listener can set this variable to `true` when it overrides this function
$page_footer_override = false;
Код: Выделить всё
$page_footer_override = true;
Конечно, все это легко и просто вручную переделывается в шаблоне, но хочется реализовать расширением, чтобы меньше проблем при обновлении было. Подскажите, как реализовать