CodeIgniter Forums
Switched to PHP5 and CI Broke, Please help! - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: Switched to PHP5 and CI Broke, Please help! (/showthread.php?tid=10461)

Pages: 1 2


Switched to PHP5 and CI Broke, Please help! - El Forum - 07-31-2008

[eluser]otherjohn[/eluser]
Hi all,
Can you help me find out what to change to make this fix.
I get this error
Fatal error: Call to undefined method CI_Loader::_reverseFormatNumber() in ...../**/application/views/index_view.php on line 12

line 12
Code:
<h3>&lt;?php echo anchor($this->_reverseFormatNumber(2,$row->phoneID),$this->_reverseFormatNumber(2,$row->phoneID)); ?&gt;</h3>

and the code for _reverseFormatNumber
Code:
function _reverseFormatNumber($format,$number){
    
        if($format ==1){
            return "(".substr($number,0,3).") ".substr($number,3,3)."-".substr($number,6,4);
        }else if($format == 2){
            return substr($number,0,3)."-".substr($number,3,3)."-".substr($number,6,4);
        
        }
    }



Switched to PHP5 and CI Broke, Please help! - El Forum - 07-31-2008

[eluser]The Wizard[/eluser]
shouldnt CI work with PHP5 too?


Switched to PHP5 and CI Broke, Please help! - El Forum - 07-31-2008

[eluser]wiredesignz[/eluser]
It appears you are trying to call the method in a ($this) controller from inside the view.

In PHP5, CI_Loader is a seperate object so does not allow controller calls from views.

Move the function to a helper.


Switched to PHP5 and CI Broke, Please help! - El Forum - 07-31-2008

[eluser]otherjohn[/eluser]
Yeh, I did that and it works now, thanks!


Switched to PHP5 and CI Broke, Please help! - El Forum - 09-07-2008

[eluser]dbashyal[/eluser]
[quote author="wiredesignz" date="1217565907"]It appears you are trying to call the method in a ($this) controller from inside the view.

In PHP5, CI_Loader is a seperate object so does not allow controller calls from views.

Move the function to a helper.[/quote]

Thanks wiredesignz.

I was having hard time too with this.

you saved my life.


Switched to PHP5 and CI Broke, Please help! - El Forum - 03-24-2010

[eluser]rip_pit[/eluser]
[SOLVED!]
sorry to reup this old post but i now get a very similar error

The error is
Quote:Call to undefined method CI_Loader::myfunction() in /xxx/www/system/application/libraries/MY_Controller.php on line 108

removed by author

EDIT:
Sorry guys, i finally solved the problem

it was only due to an incorrect case in filename : missing uppercase in

MY_loader.php

it should be
MY_Loader.php

i didn't seen this problem while working under windows, but only when online. solved now Big Grin


Switched to PHP5 and CI Broke, Please help! - El Forum - 08-05-2010

[eluser]Phani K[/eluser]
Hi Guys...
Please help me here...

Fatal error: Call to undefined method CI_Loader:Confusedetdata() in /opt/lampp/htdocs/ci/system/application/controllers/auth.php on line 159

When i am using "auth" library for user authentication module. What i have to do.....?


Switched to PHP5 and CI Broke, Please help! - El Forum - 08-05-2010

[eluser]WanWizard[/eluser]
Find out where this setdata() comes from, because the loader library doesn't have a method by that name.

It looks like the auth library was written for an old version (1.5.x) of CodeIgniter. Lots might have been changed since then. I suggest you switch to Ion Auth. Well maintained, and works perfectly.


Switched to PHP5 and CI Broke, Please help! - El Forum - 08-05-2010

[eluser]Phani K[/eluser]
Thanks for your post.

Even i tried with Ion Auth, i am facing lot of problems.as i am new to this.... can you please provide me a step-by-step documentation with the same.


Switched to PHP5 and CI Broke, Please help! - El Forum - 08-05-2010

[eluser]WanWizard[/eluser]
A bit difficult if you keep "the lot of problems" to yourself.

What's your environment? What have you done? What went wrong?

Did you take the time to go through the examples and the user guide that comes with Ion Auth (http://github.com/benedmunds/CodeIgniter-Ion-Auth)?