doumao8355 2011-11-08 08:43
浏览 31

与CodeIgniter中的扩展库交互

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.

  • 写回答

1条回答 默认 最新

  • doutiao2540 2011-11-16 23:05
    关注

    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.

    评论

报告相同问题?

悬赏问题

  • ¥15 stata安慰剂检验作图但是真实值不出现在图上
  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题