Gregwar\RST\SubDirective::process PHP Méthode

process() final public méthode

Process a directive that should parces the next node as a "sub" document
final public process ( Parser $parser, $node, $variable, $data, array $options )
$parser Parser
$options array
    public final function process(Parser $parser, $node, $variable, $data, array $options)
    {
        $subParser = $parser->getSubParser();
        if ($node instanceof CodeNode) {
            $document = $subParser->parseLocal($node->getValue());
        } else {
            $document = $node;
        }
        $newNode = $this->processSub($parser, $document, $variable, $data, $options);
        if ($newNode) {
            if ($variable) {
                $parser->getEnvironment()->setVariable($variable, $newNode);
            } else {
                $parser->getDocument()->addNode($newNode);
            }
        }
    }