Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


How to include js from controller and view in zend?



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

Post New Answer

More Zend Interview Questions

How to get all get data in zend framework?

1 Answers  


What is authorization in zend framework?

1 Answers  


What is full form of cla in zend framework?

1 Answers  


What zend acl?

1 Answers  


How to set up 2 navigations in zend framework 2?

1 Answers  


What is zend framework?

1 Answers  


Explain the filters in zend framework with examples?

1 Answers  


How to include js from controller and view in zend framework?

1 Answers  


Can we call a model in view?

1 Answers  


What should I know about the zend framework cla before submitting it?

1 Answers  


What is a module in zend framework 2?

1 Answers  


What are plugins in zend framework?

1 Answers  


Categories