original_string: public function activeChild()
      {
          $uri = Grav::instance()['uri'];
          $pages = Grav::instance()['pages'];
          $uri_path = rtrim(urldecode($uri->path()), '/');
          $routes = Grav::instance()['pages']->routes();
  
          if (isset($routes[$uri_path])) {
              /** @var PageInterface $child_page */
              $child_page = $pages->dispatch($uri->route())->parent();
              if ($child_page) {
                  while (!$child_page->root()) {
                      if ($this->path() === $child_page->path()) {
                          return true;
                      }
                      $child_page = $child_page->parent();
                  }
              }
          }
  
          return false;
      }
code: public function activeChild()
      {
          $uri = Grav::instance()['uri'];
          $pages = Grav::instance()['pages'];
          $uri_path = rtrim(urldecode($uri->path()), '/');
          $routes = Grav::instance()['pages']->routes();
  
          if (isset($routes[$uri_path])) {
              /** @var PageInterface $child_page */
              $child_page = $pages->dispatch($uri->route())->parent();
              if ($child_page) {
                  while (!$child_page->root()) {
                      if ($this->path() === $child_page->path()) {
                          return true;
                      }
                      $child_page = $child_page->parent();
                  }
              }
          }
  
          return false;
      }
code_tokens: public function activeChild ( ) { $ uri = Grav :: instance ( ) [ 'uri' ] ; $ pages = Grav :: instance ( ) [ 'pages' ] ; $ uri_path = rtrim ( urldecode ( $ uri -> path ( ) ) , '/' ) ; $ routes = Grav :: instance ( ) [ 'pages' ] -> routes ( ) ; if ( isset ( $ routes [ $ uri_path ] ) ) { /** @var PageInterface $child_page */ $ child_page = $ pages -> dispatch ( $ uri -> route ( ) ) -> parent ( ) ; if ( $ child_page ) { while ( ! $ child_page -> root ( ) ) { if ( $ this -> path ( ) === $ child_page -> path ( ) ) { return true ; } $ child_page = $ child_page -> parent ( ) ; } } } return false ; }
docstring: Returns whether or not this URI's URL contains the URL of the active page.
  Or in other words, is this page's URL in the current URL
  
  @return bool True if active child exists
docstring_tokens: Returns whether or not this URI s URL contains the URL of the active page . Or in other words is this page s URL in the current URL