• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
how to call a function of a controler

#1
[eluser]aktosci[/eluser]
I have a controler
function index()
function f1()
{
..
}

Il would like to use this fonction1 in a second fonction

function f2()
{
..
f1()
..
}

How is the systax ? In normal php it works well but here I dupplicate my code. I don't use the benefit of CI.

#2
[eluser]TheFuzzy0ne[/eluser]
You'd need to prefix it with [/b]$this->[/b]:
Code:
$this->f2();

#3
[eluser]aktosci[/eluser]
Thank you it was what I was looking for.


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


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