0

As a side note, I know the Javascript library is experimental but I'm doing some work with it nonetheless.

I have extended both the Javascript library and the jQuery library in CI.

MY_Javascript extends CI_Javascript

and

MY_Jquery extends CI_Jquery

Independently these work almost perfectly, If performing a click function with:

$this->javascript->click('#target', code_to_run());

the javascript library essentially just calls:

$this->js->_click($target, $code)

In keeping with this syntax, my extended javascript and jquery libraries contain function dialog() and function _dialog() respectively.

However, when I call $this->javascript->dialog() when it references $this->js->_dialog() it's giving me an internal error. But if I change the contents of $this->javascript->dialog()to just return "Test return" everything works fine.

I've also done return print_r($this->js); which doesn't show any of the _functions.

If I understand how extending a library in CI works everything should still work out.

Or perhaps this has nothing to do with CI and is a PHP paradigm that I've just completely missed.

R Down
  • 2,292
  • 2
  • 17
  • 23

1 Answers1

0

I think the answer lies here here What's the deal with a leading underscore in PHP class methods?. Although I can't devote enough time to confirm that those functions are private. Interesting to know about the underscore though.

Community
  • 1
  • 1
R Down
  • 2,292
  • 2
  • 17
  • 23