duandanbeng1829 2017-10-23 07:48
浏览 46

如何在Codeigniter 3中需要时自动调用插件?

Let's say I have a module of index (model view and controller).
On the index page I want to use a Highchart for example.
The simplest practise to do this is by including the highchart.js on my template.

But what if I don't want to include the highchart.js on my other pages?

If I include all of my plugins on the template it would be a waste and also the page could take a longer time to load. Is there any way in Codeigniter 3 to load the plugins only when needed?

  • 写回答

4条回答 默认 最新

  • doufu9145 2017-10-23 08:16
    关注

    This is completely your handle on which page, which plugin you have to load. You can include js, css dynamically. You can statically mention in all view page which js or css should include or you can pass over to controller.

    Here is some reference. Hope it will help:
    1) Codeigniter - how to include a dynamic javascript file in a view
    2) how to load css, js dynamically in codeigniter

    评论

报告相同问题?

悬赏问题

  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?
  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计