summaryrefslogtreecommitdiffstats
path: root/src/View/PluginInterface.php
blob: 0a9ab7add21e38c459b01244606219ebdeb35e78 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<?php

namespace Jasny\View;

use Jasny\ViewInterface;

/**
 * A view plugin can be used to add functionality to a view.
 */
interface PluginInterface
{
    /**
     * Called when the plugin is added to the view.
     * 
     * @param ViewInterface $view
     */
    public function onAdd(ViewInterface $view);
    
    /**
     * Called when view renders a template.
     * 
     * @param ViewInterface $view
     * @param string        $template   Template filename
     * @param array         $context
     */
    public function onRender(ViewInterface $view, $template, array $context);
}