How to include js from controller and view in zend?
Answer / Vivek Mathur
You can include JavaScript files from a controller or view in Zend Framework by using the `headScript()` method. Here's an example:
In your controller action:
```php
$this->getHelper('viewRenderer')->headScript()->appendFile('/path/to/your/script.js');
```
In your view script:
```php
echo $this->headScript()->appendFile('/path/to/your/script.js');
```
| Is This Answer Correct ? | 0 Yes | 0 No |
What are the features of mvc in zend framework?
Do you know what is the function lucene?
What are the default methods provided by decorators?
What is zendauthentication?
How to install zend framework on windows?
Write a program to show the function of action helper?
How do you set module name, controller name, and action name in zend framework?
What is zend engine?
How to access route, post, get etc. Parameters in zend framework 2?
What is zend engine in php?
How can you get a module name in bootstrap file.
Which version of php does zend framework require?