1.

How To Include Js From Controller And View In Zend

Answer»

From WITHIN a view FILE: $this->headScript()->appendFile(‘filename.js’);
From within a controller: $this->view->headScript()->appendFile(‘filename.js’);

And then SOMEWHERE in your layout you NEED to ECHO out your headScript object:

headScript();?>

From within a view file: $this->headScript()->appendFile(‘filename.js’);
From within a controller: $this->view->headScript()->appendFile(‘filename.js’);

And then somewhere in your layout you need to echo out your headScript object:

headScript();?>



Discussion

No Comment Found