summaryrefslogtreecommitdiff
path: root/doc/plugin-registration.markdown
diff options
context:
space:
mode:
authorFrederic Guillot <fred@kanboard.net>2016-09-05 11:02:06 -0400
committerFrederic Guillot <fred@kanboard.net>2016-09-05 11:02:06 -0400
commit49788b70eca710f8ca17e99ca447053ae598173b (patch)
treeebdbbeda4d3554c1b11cebdfeb070718b221732e /doc/plugin-registration.markdown
parent21f8cebe855aaaf0e6ff6b38a032216df8bdb8c6 (diff)
Update documentation
Diffstat (limited to 'doc/plugin-registration.markdown')
-rw-r--r--doc/plugin-registration.markdown20
1 files changed, 20 insertions, 0 deletions
diff --git a/doc/plugin-registration.markdown b/doc/plugin-registration.markdown
index 74dc160a..a9273e1d 100644
--- a/doc/plugin-registration.markdown
+++ b/doc/plugin-registration.markdown
@@ -159,3 +159,23 @@ $this->cli->add(new MyCommand());
```
Read the library documentation for more information.
+
+Add new task filters
+--------------------
+
+Since the task lexer is a factory that returns a new instance each time,
+you have to extend the `taskLexer` container with the method `extend()` of Pimple.
+
+Here is a example:
+
+```php
+public function initialize()
+{
+ $this->container->extend('taskLexer', function($taskLexer, $c) {
+ $taskLexer->withFilter(TaskBoardDateFilter::getInstance($c)->setDateParser($c['dateParser']));
+ return $taskLexer;
+ });
+}
+```
+
+For the filter class implementation, there are several examples in the source code under the namespace `Kanboard\Filter`.