public function init()
    {
        $grav = Grav::instance();
        /** @var Config $config */
        $config = $grav['config'];

        $asset_config = (array)$config->get('system.assets');

        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];
        $this->assets_dir = $locator->findResource('asset://') . DS;
        $this->assets_url = $locator->findResource('asset://', false);

        $this->config($asset_config);

        // Register any preconfigured collections
        foreach ((array) $this->collections as $name => $collection) {
            $this->registerCollection($name, (array)$collection);
        }
    }
public function init()
    {
        $grav = Grav::instance();
        /** @var Config $config */
        $config = $grav['config'];

        $asset_config = (array)$config->get('system.assets');

        /** @var UniformResourceLocator $locator */
        $locator = $grav['locator'];
        $this->assets_dir = $locator->findResource('asset://') . DS;
        $this->assets_url = $locator->findResource('asset://', false);

        $this->config($asset_config);

        // Register any preconfigured collections
        foreach ((array) $this->collections as $name => $collection) {
            $this->registerCollection($name, (array)$collection);
        }
    }
public function init ( ) { $ grav = Grav :: instance ( ) ; /** @var Config $config */ $ config = $ grav [ 'config' ] ; $ asset_config = ( array ) $ config -> get ( 'system.assets' ) ; /** @var UniformResourceLocator $locator */ $ locator = $ grav [ 'locator' ] ; $ this -> assets_dir = $ locator -> findResource ( 'asset://' ) . DS ; $ this -> assets_url = $ locator -> findResource ( 'asset://' , false ) ; $ this -> config ( $ asset_config ) ; // Register any preconfigured collections foreach ( ( array ) $ this -> collections as $ name => $ collection ) { $ this -> registerCollection ( $ name , ( array ) $ collection ) ; } }
Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration
Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration