From 49788b70eca710f8ca17e99ca447053ae598173b Mon Sep 17 00:00:00 2001 From: Frederic Guillot Date: Mon, 5 Sep 2016 11:02:06 -0400 Subject: Update documentation --- doc/plugin-registration.markdown | 20 ++++++++++++++++++++ doc/update.markdown | 2 +- 2 files changed, 21 insertions(+), 1 deletion(-) (limited to 'doc') 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`. diff --git a/doc/update.markdown b/doc/update.markdown index 4aa59fff..68e1f587 100644 --- a/doc/update.markdown +++ b/doc/update.markdown @@ -9,7 +9,7 @@ Important things to do before updating -------------------------------------- - **Always make a backup of your data before upgrading** -- Check that your backup is valid +- Check that your backup is valid! - Always read the [change log](https://github.com/kanboard/kanboard/blob/master/ChangeLog) to check for breaking changes - Always close all user sessions (flush all sessions on the server) -- cgit v1.2.3