chesspiece423 Posted October 7, 2014 Share Posted October 7, 2014 how can you do this? EXAMPLE: in my PHP FILE public function getSum($num1,$num2) {return $num1+$num2; } $data->assign(array( 'sum' => $this->getSum($num1,$num2) )); TEMPLATE FILE: In my template file, how can I call it? I tried the following: >>{$sum('2','5')} // should display 7 >>{assign var=num1 value="1"}>>{assign var=num2 value="5"} >>{$sum($num1,$num2)} // should display 7 Nothing seems to work. Link to comment Share on other sites More sharing options...
chesspiece423 Posted October 8, 2014 Author Share Posted October 8, 2014 bump! please help! Link to comment Share on other sites More sharing options...
chesspiece423 Posted October 8, 2014 Author Share Posted October 8, 2014 bump!!! in php i can do it with <?php $x = new Controller; echo $x->getSum('2','7'); //displays 7 ?> Link to comment Share on other sites More sharing options...
Recommended Posts