Call function from another function

I have a small question.

I have 2 functions in 1 controller
Say Function A and Function B

Is it possible to call function B at the end of Function A?
If so, how is this done?

I know i can call a view but i don't want a view at the end of function A

If the second function is an action with its own view you could redirect to that action

Or if the function is just some controller logic you can call the method using:


This works fine
Thank you!

No problem,

Also if the method is just controller logic then put an underscore before the function name so that it can't be accessed from a URL e.g. http://website/controller/function_b


This "http://website/controller/function_b" will no longer work.

is it also possible to send variables from function a to function b?

Because i want something like this(this is just an example):
  $foo = "1";

echo $foo+1;


$foo = "10";
echo $foo;

Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  

  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.