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 |
How to get all get data in zend framework?
What is authorization in zend framework?
What is full form of cla in zend framework?
What zend acl?
How to set up 2 navigations in zend framework 2?
What is zend framework?
Explain the filters in zend framework with examples?
How to include js from controller and view in zend framework?
Can we call a model in view?
What should I know about the zend framework cla before submitting it?
What is a module in zend framework 2?
What are plugins in zend framework?