fewbricks\fewbricks::autoload PHP Method

autoload() private static method

private static autoload ( $class )
$class
    private static function autoload($class)
    {
        $namespace_parts = explode('\\', $class);
        // Make sure that we are dealing with something in fewbricks
        if ($namespace_parts[0] === 'fewbricks') {
            $file_name = str_replace('_', '-', end($namespace_parts)) . '.php';
            // If are dealing with a brick
            if ($namespace_parts[1] === 'bricks') {
                self::autoload_brick($file_name);
            } else {
                // User wants a field
                self::autoload_field($file_name);
            }
        }
    }