Source of file TestCommand.php
Size: 0,595 Bytes - Last Modified: 2021-12-23T10:28:55+00:00
/var/www/docs.ssmods.com/process/src/code/TestCommand.php
12345678910111213141516171819202122232425 | <?php /** * @package commands * @subpackage code * @author Rainer Spittel (rainer at silverstripe dot com) * * This is an example for a command implementation. The command will expect * array keys 'x' and 'y' and the command will multiply the two integer-values. * * No validation has been implemented. * * Please see the README file for more information. */ class TestCommand extends ControllerCommand { /** * Perform the action/command */ public function execute() { $data = $this->getParameters(); $x = $data['x']; $y = $data['y']; return (int)$x * (int) $y; } } |