Skip to content

New Config helper #1071

@lonnieezell

Description

@lonnieezell

Inspired by #1070:

  • new CodeIgniter\Config\Config class with one public static method: get(). This takes a class name and returns an instance of the class.
  • By default it returns a shared instance, but a new instance can be returned by setting the second parameter to false, just like the Services class.
  • If the config name is fully qualified (Config\App) it will simply try to instantiate/cache and return.
  • If the config name does not include the namespace (App), it will attempt to discover the class similar to way the Services class does, though don't discover and preload all of them, just as requested.
  • new helper method, config() that is just a slightly nicer way of calling CodeIgniter\Config\Config::get().

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions