PHPackages                             nanjingboy/classloader - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. nanjingboy/classloader

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

nanjingboy/classloader
======================

Auto loading the missing class while the file's name starts with lowercase char

v0.1.1(11y ago)0127MITPHPPHP &gt;=5.4.0

Since Oct 25Pushed 11y ago1 watchersCompare

[ Source](https://github.com/nanjingboy/classloader)[ Packagist](https://packagist.org/packages/nanjingboy/classloader)[ Docs](https://github.com/nanjingboy/classloader)[ RSS](/packages/nanjingboy-classloader/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (3)Used By (0)

### ClassLoader:

[](#classloader)

ClassLoader is a tool to auto loading the missing class while the file's name starts with lowercase char.

### Getting Started:

[](#getting-started)

- Create composer.json file in root directory of your application:

```
 {
    "require": {
        "php": ">=5.4.0",
        "nanjingboy/classloader": "*"
    }
}
```

- Install it via [composer](https://getcomposer.org/doc/00-intro.md)

### Usage Example:

[](#usage-example)

Imagine the following application structure:

```
application
├── models
│   └─── user.php

```

If we want to access the class Models\\User, we should register a classLoader like this:

```
