original_string: public function pageHeaderVarFunc($var, $pages = null)
      {
          if ($pages === null) {
              $pages = $this->grav['page'];
          }
  
          // Make sure pages are an array
          if (!\is_array($pages)) {
              $pages = [$pages];
          }
  
          // Loop over pages and look for header vars
          foreach ($pages as $page) {
              if (\is_string($page)) {
                  $page = $this->grav['pages']->find($page);
              }
  
              if ($page) {
                  $header = $page->header();
                  if (isset($header->{$var})) {
                      return $header->{$var};
                  }
              }
          }
  
          return null;
      }
code: public function pageHeaderVarFunc($var, $pages = null)
      {
          if ($pages === null) {
              $pages = $this->grav['page'];
          }
  
          // Make sure pages are an array
          if (!\is_array($pages)) {
              $pages = [$pages];
          }
  
          // Loop over pages and look for header vars
          foreach ($pages as $page) {
              if (\is_string($page)) {
                  $page = $this->grav['pages']->find($page);
              }
  
              if ($page) {
                  $header = $page->header();
                  if (isset($header->{$var})) {
                      return $header->{$var};
                  }
              }
          }
  
          return null;
      }
code_tokens: public function pageHeaderVarFunc ( $ var , $ pages = null ) { if ( $ pages === null ) { $ pages = $ this -> grav [ 'page' ] ; } // Make sure pages are an array if ( ! \ is_array ( $ pages ) ) { $ pages = [ $ pages ] ; } // Loop over pages and look for header vars foreach ( $ pages as $ page ) { if ( \ is_string ( $ page ) ) { $ page = $ this -> grav [ 'pages' ] -> find ( $ page ) ; } if ( $ page ) { $ header = $ page -> header ( ) ; if ( isset ( $ header -> { $ var } ) ) { return $ header -> { $ var } ; } } } return null ; }
docstring: Look for a page header variable in an array of pages working its way through until a value is found
  
  @param string $var
  @param string|string[]|null $pages
  @return mixed
docstring_tokens: Look for a page header variable in an array of pages working its way through until a value is found