Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Node.php

function Node::traverse

Traverses the current node and all its child nodes using the given function

Parameters

callable $fn Function that will be called on each node:

array $options Options array. See Traverser class: documentation for available options

Return value

$this

File

vendor/mck89/peast/lib/Peast/Syntax/Node/Node.php, line 171

Class

Node
Base class for all the nodes generated by Peast.

Namespace

Peast\Syntax\Node

Code

public function traverse(callable $fn, $options = array()) {
    $traverser = new \Peast\Traverser($options);
    $traverser->addFunction($fn)
        ->traverse($this);
    return $this;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal