/
file_library.html
36 lines (31 loc) · 1.15 KB
/
file_library.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
---
layout: default
navPage: docs
heading: library.php
breadcrumbs:
- Module Development,/module_development/
- Form Tools 3,/module_development/ft3/
- Anatomy of a Module,/module_development/ft3/anatomy/
- library.php
prev: Language Files,/module_development/ft3/file_lang/
next: smarty_plugins/,/module_development/ft3/smarty/
categories: module_development
versions: FT3
---
{% include open_section.html nav='nav_module_development_ft3.html' selected='file_library' nav_width=4 %}
<p>
Every module must contain a <code>library.php</code> file in the module root folder. This file should include
all classes and all code that your module needs to execute. This file is automatically imported when you do
the <a href="{{site.baseurl}}/module_development/ft3/init_module_page/">Modules::initModulePage()</a> call
in your module pages.
</p>
<p>
Here's a simple bare-bones example, taken from the <a href="{{site.baseurl}}/modules/hello_world/">Hello World</a>
module.
</p>
{% codemirror php %}
<?php
require(__DIR__ . "/code/Module.class.php");
?>
{% endcodemirror %}
{% include close_section.html %}