Welcome Guest, Not a member yet? Register   Sign In
Private function
#4

[eluser]boltsabre[/eluser]
You cannot call a private function from another controller, it goes against the whole idea of OOP - you made it private, that means you cannot touch it except from inside the same controller. So move it to the correct contoller and you'll be fine!

If your function is returning something (a value) just call as such to get the value it returns:

Code:
$callMyPrivateFunction = __myPrivateFucntion();

if ($callMyPrivateFunction == 1) // or whatever you want to do with it.

The nature of 'redirect', which your currently doing, is a bit like 'load->view...'. Basically your telling your controller to go to another controller... and if that controller isn't loading a view or anything, what do you expect to display on the screen to the user?


Messages In This Thread
Private function - by El Forum - 07-08-2011, 05:04 AM
Private function - by El Forum - 07-08-2011, 05:07 AM
Private function - by El Forum - 07-08-2011, 05:16 AM
Private function - by El Forum - 07-08-2011, 05:38 AM
Private function - by El Forum - 07-08-2011, 06:54 AM
Private function - by El Forum - 07-08-2011, 07:12 AM



Theme © iAndrew 2016 - Forum software by © MyBB