# THIRD-PARTY MODULES Many webtrees functions are provided by “modules”. Modules allows you to add additional features to webtrees and modify existing features. ## Installing and uninstalling modules A module is a folder containing a file called `module.php`. There may be other files in the folder. To install a module, copy its folder to `modules_v4`. To uninstall it, delete its folder from `modules_v4`. Note that module names (i.e. their folder names) must not contain spaces or the characters `.`, `[` and `]`. TIP: renaming a module from `` to `` is a quick way to hide it from webtrees. This works because modules containing `.` are ignored. ## Writing modules To write a module, you need to understand the PHP programming langauge. The rest of this document is aimed at PHP developers. TIP: The built-in modules can be found in `app/Module/*.php`. These contain lots of useful examples that you can copy/paste. ## Creating a custom module. This is the minimum code needed to create a custom module. ```php timeout_service = $timeout_service; // You can replace core webtrees classes by providing alternate implementations: app()->bind('name of webtrees class', 'name of replacement class'); app()->bind('name of webtrees class', new \stdClass()); } /** * Methods that are called in response to HTTP requests use * dependency-injection. You'll almost certainly need the request * object. The restrictions on the constructor do not apply here. * * @param Request $request * * @return Response */ public function getFooBarAction(Request $request): Response { return new Response($request->get('foo')); } }; ```