original_string: public function init(\SplFileInfo $file, $extension = null)
      {
          $config = Grav::instance()['config'];
  
          // some extension logic
          if (empty($extension)) {
              $this->extension('.' . $file->getExtension());
          } else {
              $this->extension($extension);
          }
  
          // extract page language from page extension
          $language = trim(basename($this->extension(), 'md'), '.') ?: null;
          $this->language($language);
  
          $this->hide_home_route = $config->get('system.home.hide_in_urls', false);
          $this->home_route = $this->adjustRouteCase($config->get('system.home.alias'));
          $this->filePath($file->getPathname());
          $this->modified($file->getMTime());
          $this->id($this->modified() . md5($this->filePath()));
          $this->routable(true);
          $this->header();
          $this->date();
          $this->metadata();
          $this->url();
          $this->visible();
          $this->modularTwig(strpos($this->slug(), '_') === 0);
          $this->setPublishState();
          $this->published();
          $this->urlExtension();
  
  
          return $this;
      }
code: public function init(\SplFileInfo $file, $extension = null)
      {
          $config = Grav::instance()['config'];
  
          // some extension logic
          if (empty($extension)) {
              $this->extension('.' . $file->getExtension());
          } else {
              $this->extension($extension);
          }
  
          // extract page language from page extension
          $language = trim(basename($this->extension(), 'md'), '.') ?: null;
          $this->language($language);
  
          $this->hide_home_route = $config->get('system.home.hide_in_urls', false);
          $this->home_route = $this->adjustRouteCase($config->get('system.home.alias'));
          $this->filePath($file->getPathname());
          $this->modified($file->getMTime());
          $this->id($this->modified() . md5($this->filePath()));
          $this->routable(true);
          $this->header();
          $this->date();
          $this->metadata();
          $this->url();
          $this->visible();
          $this->modularTwig(strpos($this->slug(), '_') === 0);
          $this->setPublishState();
          $this->published();
          $this->urlExtension();
  
  
          return $this;
      }
code_tokens: public function init ( \ SplFileInfo $ file , $ extension = null ) { $ config = Grav :: instance ( ) [ 'config' ] ; // some extension logic if ( empty ( $ extension ) ) { $ this -> extension ( '.' . $ file -> getExtension ( ) ) ; } else { $ this -> extension ( $ extension ) ; } // extract page language from page extension $ language = trim ( basename ( $ this -> extension ( ) , 'md' ) , '.' ) ? : null ; $ this -> language ( $ language ) ; $ this -> hide_home_route = $ config -> get ( 'system.home.hide_in_urls' , false ) ; $ this -> home_route = $ this -> adjustRouteCase ( $ config -> get ( 'system.home.alias' ) ) ; $ this -> filePath ( $ file -> getPathname ( ) ) ; $ this -> modified ( $ file -> getMTime ( ) ) ; $ this -> id ( $ this -> modified ( ) . md5 ( $ this -> filePath ( ) ) ) ; $ this -> routable ( true ) ; $ this -> header ( ) ; $ this -> date ( ) ; $ this -> metadata ( ) ; $ this -> url ( ) ; $ this -> visible ( ) ; $ this -> modularTwig ( strpos ( $ this -> slug ( ) , '_' ) === 0 ) ; $ this -> setPublishState ( ) ; $ this -> published ( ) ; $ this -> urlExtension ( ) ; return $ this ; }
docstring: Initializes the page instance variables based on a file
  
  @param  \SplFileInfo $file The file information for the .md file that the page represents
  @param  string $extension
  
  @return $this
docstring_tokens: Initializes the page instance variables based on a file