Location: PHPKode > projects > Php open model view controller > phpopenmvc/modules/Math.class.php
<?php
	class Math extends Module {
	
		// method add
		function add($a,$b){
			$ans = $a + $b;
			$this->output->assign("question", $a." + ".$b);
			$this->output->assign("answer", $ans);
		}

		// method sub
		function sub(){
			$ans = $_REQUEST['a'] - $_REQUEST['b'];
			$this->output->assign("question", $_REQUEST['a']." - ".$_REQUEST['b']);
			$this->output->assign("answer", $ans);
		}

		function onValidateError(){
			$this->output->assign("question", "Parameter Error!.");
		}

		function onValidateErrorNoView(){
			echo "<b>Parameter Error!.</b>";
		}
	}

?>
Return current item: Php open model view controller