Welcome Guest, Not a member yet? Register   Sign In
Are Helper Functions Being Cached
#1

[eluser]Cagri[/eluser]
I'm not so good at neither PHP nor CI.
I'm trying to customize a library I've downloaded. But I'm completely crashed. Here is the way I followed:

When I try to add a function to it's helper file, PHP raises undefined function.
Code:
function test(){echo('lorem');}
1) All functions already in the helper file are available. The function I've just added in is not. So file is being loaded correctly, problem is in my function

2) I renamed one of the working helpers. That function became unavailable too. So there is nothing with my function. already working function becomes unavailable if I rename it just by adding an 'a' to the end of its name... ???

3) Then I added a new helper file '. Put my function there. But I forgot to delete from the old helper file. I loaded the new file. Function worked.

4) Then I realized the old file having my function and removed the code from it.
But although I've rewritten the function, still I was getting 'lorem' output.

5) I've commented out $this->load->helper('test'); line. PHP gave undefined function call. so no duplicate code anywhere else.

6) I've loaded just my helper (out the original one). Still old code was working ('lorem').

7) I've removed the function from the test_helper. The file only has '<?php' Old code is still working if I load that empty helper file.

All I need is put a few functions in original helper and keep going... Sad
#2

[eluser]InsiteFX[/eluser]
Code:
function test()
{
    echo 'lorem';
}

InsiteFX
#3

[eluser]pickupman[/eluser]
Welcome to the forums. Perhaps you have placed your function inside another one. Make sure you are outside of the other braces of the other functions. Could you post your helper using the code button in the editor. Maybe we help you find a syntax error.
#4

[eluser]Cagri[/eluser]
@InsiteFX :
Yes that is a habit of mine which I'm trying to quit. But I don't think it was the problem since no parsing errors or kind was being raised.

@pickupman :
I've triple checked it that too. there was two functions already in file both were functioning right. As I said, just renaming one of them was enough to make them be gone.

I think my IDE was the one making my day hell again. Dreamveawer...

Since I get from your replies that this is nothing to do with a weird feature of CI, I started to look for something else.

I opened ssh and directly vi'ed the file. The problem was gone.

This is the second time Dreamveawer ruined my day in PHP (while ago I had to deal with BOM )

Now I downloaded and installed Netbeans. I'm quite stranger to it though... But I will be no more using Dw for at least PHP in my life...

Thanks for your replies.




Theme © iAndrew 2016 - Forum software by © MyBB