1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/kanboard_ynh.git synced 2024-09-03 19:36:17 +02:00
kanboard_ynh/sources/doc/plugin-overrides.markdown
2016-04-27 20:50:42 +02:00

998 B

Plugin Overrides

Override HTTP Content Security Policy

If you would like to replace the default HTTP Content Security Policy header, you can use the method setContentSecurityPolicy():

<?php

namespace Kanboard\Plugin\Csp;

use Kanboard\Core\Plugin\Base;

class Plugin extends Base
{
    public function initialize()
    {
        $this->setContentSecurityPolicy(array('script-src' => 'something'));
    }
}

Template Overrides

Any templates defined in the core can be overridden. For example, you can redefine the default layout or change email notifications.

Example of template override:

$this->template->setTemplateOverride('header', 'theme:layout/header');

The first argument is the original template name and the second argument the template to use as replacement.

You can still use the original template using the "kanboard:" prefix:

<?= $this->render('kanboard:header') ?>