]>
git.wh0rd.org - tt-rss.git/blob - plugins/example_routing/init.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. You can mask
13 // entire handler by supplying "*" instead of a method name.
19 "Example routing plugin",
24 function init($host) {
27 $host->add_handler("test", "example", $this);
28 $host->add_handler("public", "getunread", $this);
31 function getunread() {
32 print rand(0,100); # yeah right
36 print "example method called";
39 function csrf_ignore($method) {
43 function before($method) {