dongni9825 2015-01-24 00:12
浏览 41

zend框架中的jquery插件

I recently started working on a website with zend framework. I am trying to include simple jquery plugins but i have no idea what is the proper way to include them.

I have found the main index.phtml sites but none of them have a element nor the php code to include the javascript as shown in this question. I also dont have a layout.phtml file on my server.

So where are all the javascript files added? I been looking for them everywhere but cant find them. Where should i link my own jquery plugins and javascript files.

Any help on this would be appreciated I am new to zend framework.

  • 写回答

1条回答 默认 最新

  • douyihuaimao733955 2015-01-26 11:31
    关注

    Default location for layout files is in application/layouts but you can check in application/configs/application.ini for resources.layout.layoutPath to check where they are. There is a chance that your project does not use layouts (they are not required part of zend).

    You can try looking for <HTML> or <HEAD> tags or by js file names in all project files to find where they are added.

    Proper way of adding them is by using helper headScript()(usually for scripts in header of page) or/and inlineScript()(this is confusing name because usually used at bottom of page) like this:

    $this->headScript()->prependFile('/js/jQuery.js'); //this add to list of files
    $this->inlineScript()->appendFile('/js/main.js');
    

    Then add in layout:

    echo $this->headScript() //this will actually print files from list
    echo $this->inlineScript() 
    
    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?