3.5.5. instructionNodeProcess()

void instructionNodeProcess ( ioptNode $node )

The programmer has to overwrite this method, which processes the tags matching to this processor. $node contains the node created for the matching tag. This is a sample processing method, which redirects PHP to tag processing methods defined somewhere else in the class:

Example 3.16. Processing the instruction nodes

public function instructionNodeProcess(ioptNode $node)
{
	foreach($node as $block)
	{				
		switch($block -> getName())
		{
			case 'tag':
				$this -> tagBegin($block -> getAttributes());
				$this -> defaultTreeProcess($block);
				break;
			case 'tagelse':
				$this -> tagElse();
				$this -> defaultTreeProcess($block);
				break;
			case '/tag':
				$this -> tagEnd();
		}
	}
} // end process();

In the example, the method gets the node blocks and checks, which tags they match to. If the block can contain some child nodes, we call defaultTreeProcess() method in order to process them, too.