How to add an external javascript file to a Zend Framework 2 application?

后端 未结 7 2359
梦毁少年i
梦毁少年i 2021-02-07 14:42

I need to add jQuery and other javascript files to my Zend Framework project. I am trying to do it with an Action controller:-

public function userinfoAction()
{         


        
7条回答
  •  耶瑟儿~
    2021-02-07 15:18

    You aren't using the view to add jquery:

     $this->view->headScript()->appendFile('http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js');
    

提交回复
热议问题