public static function get($name)
    {
        $blueprints = new Blueprints('plugins://');
        $blueprint = $blueprints->get("{$name}/blueprints");

        // Load default configuration.
        $file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);

        // ensure this is a valid plugin
        if (!$file->exists()) {
            return null;
        }

        $obj = new Data((array)$file->content(), $blueprint);

        // Override with user configuration.
        $obj->merge(Grav::instance()['config']->get('plugins.' . $name) ?: []);

        // Save configuration always to user/config.
        $file = CompiledYamlFile::instance("config://plugins/{$name}.yaml");
        $obj->file($file);

        return $obj;
    }
public static function get($name)
    {
        $blueprints = new Blueprints('plugins://');
        $blueprint = $blueprints->get("{$name}/blueprints");

        // Load default configuration.
        $file = CompiledYamlFile::instance("plugins://{$name}/{$name}" . YAML_EXT);

        // ensure this is a valid plugin
        if (!$file->exists()) {
            return null;
        }

        $obj = new Data((array)$file->content(), $blueprint);

        // Override with user configuration.
        $obj->merge(Grav::instance()['config']->get('plugins.' . $name) ?: []);

        // Save configuration always to user/config.
        $file = CompiledYamlFile::instance("config://plugins/{$name}.yaml");
        $obj->file($file);

        return $obj;
    }
public static function get ( $ name ) { $ blueprints = new Blueprints ( 'plugins://' ) ; $ blueprint = $ blueprints -> get ( "{$name}/blueprints" ) ; // Load default configuration. $ file = CompiledYamlFile :: instance ( "plugins://{$name}/{$name}" . YAML_EXT ) ; // ensure this is a valid plugin if ( ! $ file -> exists ( ) ) { return null ; } $ obj = new Data ( ( array ) $ file -> content ( ) , $ blueprint ) ; // Override with user configuration. $ obj -> merge ( Grav :: instance ( ) [ 'config' ] -> get ( 'plugins.' . $ name ) ? : [ ] ) ; // Save configuration always to user/config. $ file = CompiledYamlFile :: instance ( "config://plugins/{$name}.yaml" ) ; $ obj -> file ( $ file ) ; return $ obj ; }
Get a plugin by name

@param string $name

@return Data|null
Get a plugin by name