For example I have a view calculate.ctp and inside that I want to call a function add(7,5); then of course it will display the output.
where will I create the function
function add($num1, $num2)
{
$ans = $num1 + $num2;
return $ans;
}
and how can I call that function in the calculate.ctp?
I think its better create a helper for your common functions and put your common functions inside this helper