Skip to content

Ability to add namespace to FileLocator class #1552

Description

@amigoscs

I add a namespace (Services::autoloader()->addNamespace()) and expect the FileLocator class to look for my class also in the added namespace, but this does not happen.

Example:

In my controller
Services::autoloader()->addNamespace('MyPlugin', APPPATH . 'Plugins/MyPlugin/');

Next, I try to access the language file
Lang('MyPlugin.title')

I expect the Language class will also load the file along the way
APPPATH . 'Plugins/MyPlugin/Language/{locale}/MyPlugin.php

but this is not happening

CodeIgniter 4 version
CodeIgniter 4.0.0 alpha 2

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions