]>
git.wh0rd.org - tt-rss.git/blob - plugins/example_routing/example_routing.php
2 class Example_Routing
extends Plugin
implements IHandler
{
4 // Demonstrates adding a custom handler and method:
5 // backend.php?op=test&method=example
6 // and masking a system builtin public method:
7 // public.php?op=getUnread
9 // Plugin class must implelement IHandler interface and has
10 // a public method of same name as being registered.
12 // Any system method may be masked by plugins.
17 function __construct($host) {
18 $this->link
= $host->get_link();
21 $host->add_handler("test", "example", $this);
22 $host->add_handler("public", "getunread", $this);
25 function getunread() {
26 print rand(0,100); # yeah right
30 print "example method called";
33 function csrf_ignore($method) {
37 function before($method) {