<p>It does in fact need to be loaded on every request, because otherwise your <code>EVENT_REGISTER_FIELD_TYPES</code> event listener wouldn’t get registered, which is responsible for telling Craft that the field type exists.</p>

CC BY-SA 4.0
2019-06-17T22:05:04.980Z
This makes sense, thanks for the feedback. Is there a rule of thumb on when it's save to not put the module in the `bootstrap`-array?
Lukas Knuth
CC BY-SA 4.0
2019-06-17T23:56:04.467Z
Yeah, when your module isn’t doing anything special in `init()`.
Brandon Kelly
CC BY-SA 4.0
2019-06-19T14:19:47.253Z
"special" meaning not registering anything via `Event`?
Lukas Knuth
CC BY-SA 4.0
2019-06-19T18:06:44.160Z
That’s one example, yes.
Brandon Kelly
CC BY-SA 4.0
2019-06-16T16:18:02.003Z
2019-06-16T16:18:02.003Z
Brandon Kelly
<p>I'm expanding my Craft website with a small Module, internal to this project. The module currently only defines a new input-field (extending <code>craft\base\Field</code>).</p>

<p>I have dumped the autoloader from composer and my <code>config/app.php</code> only contains the registration of this module:</p>

<pre><code>&lt;?php
return [
    'modules' =&gt; [
        'simple-markdown-editor' =&gt; [
            'class' =&gt; \codeisland\simplemde\MarkdownModule::class,
        ],
    ],
    'bootstrap' =&gt; ['simple-markdown-editor'],
];
</code></pre>

<p>This setup works and the new field shows up in the Admin CP. <strong>But</strong>: as far as I understand the <code>bootstrap</code>-entry, it's only needed if the module needs to be executed on <em>every page render</em>. The <a href="https://docs.craftcms.com/v3/extend/module-guide.html#update-the-application-config" rel="nofollow noreferrer">Craft documentation</a> says as much:</p>

<blockquote>
  <p>TIP: If your module doesn’t need to get loaded on every request, you can remove its ID from the bootstrap array.</p>
</blockquote>

<p>Since the module only defines an input-field for the Admin CP, it doesn't need to be loaded on every request. But if I remove it from the <code>bootstrap</code>-array, it's not loaded at all.</p>

<p>Do I need to add additional config? Or am I just misunderstanding the documentation?</p>

CC BY-SA 4.0
2019-06-15T16:20:20.127Z
I’ve experienced this too. Curious to know if this is a bug, a documentation error, or if there is some legitimate workaround.
Lindsey D
<modules>
Module not loading unless bootstrapped
# Module not loading unless bootstrapped

(Asked by: username_0 on 2019-06-15)

I'm expanding my Craft website with a small Module, internal to this project. The module currently only defines a new input-field (extending craft\base\Field).
I have dumped the autoloader from composer and my config/app.php only contains the registration of this module:
 [
        'simple-markdown-editor' => [
            'class' => \codeisland\simplemde\MarkdownModule::class,
        ],
    ],
    'bootstrap' => ['simple-markdown-editor'],
];

This setup works and the new field shows up in the Admin CP. But: as far as I understand the bootstrap-entry, it's only needed if the module needs to be executed on every page render. The Craft documentation says as much:

TIP: If your module doesn’t need to get loaded on every request, you can remove its ID from the bootstrap array.

Since the module only defines an input-field for the Admin CP, it doesn't need to be loaded on every request. But if I remove it from the bootstrap-array, it's not loaded at all.
Do I need to add additional config? Or am I just misunderstanding the documentation?

**Tags:** modules

> **Comments:**
> **username_1**: I’ve experienced this too. Curious to know if this is a bug, a documentation error, or if there is some legitimate workaround.  

---

## 1 answers

### Answer by username_2 on 2019-06-16. Score: 2

It does in fact need to be loaded on every request, because otherwise your `EVENT_REGISTER_FIELD_TYPES` event listener wouldn’t get registered, which is responsible for telling Craft that the field type exists.

> **Comments:**
> **username_0**: This makes sense, thanks for the feedback. Is there a rule of thumb on when it's save to not put the module in the `bootstrap`-array?  
> **username_2**: Yeah, when your module isn’t doing anything special in `init()`.  
> **username_0**: "special" meaning not registering anything via `Event`?  
> **username_2**: That’s one example, yes.  

---

