[Routing] Moving include instruction to separate method

| Q             | A
| ------------- | ---
| Bug fix?      | [yes]
| New feature?  | [no]
| BC breaks?    | [no]
| Deprecations? | [no]
| Tests pass?   | [yes]
| Fixed tickets | #12106
| License       | MIT
the ``$loader`` variable should be defined inside this function (inted of doing it in ``load()``, otherwise a PHP file cannot import other files anymore, which is a BC break (looks like we are missing a test for it btw)