5.5.6. Handling $opt special block

1.Your instructions can extend the $opt special block. Just write a special method processOpt() in the processor. The compiler will redirect there the calls of $opt.processorname.etc. The method must take exactly one parameter, which is an array of the block structure (for the code above it will be: 0=>opt; 1=>processorname; 2=>etc). The method must return the PHP code that the block will be replaced to.

Example 5.11. Handling $opt special block

public function processOpt($namespace)
{
	return '\''.sha1($namespace[2]).'\'';
} // end processOpt();

This code will handle each call of $opt.processor.ppp and will encrypt the ppp string with the SHA1 algorithm.