original_string: 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);
          }
      }
code: 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);
          }
      }
code_tokens: 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 ) ; } }
docstring: Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration
docstring_tokens: Initialization called in the Grav lifecycle to initialize the Assets with appropriate configuration