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

What are the features of mvc in zend framework?

1 Answers  


Do you know what is the function lucene?

1 Answers  


What are the default methods provided by decorators?

1 Answers  


What is zendauthentication?

1 Answers  


How to install zend framework on windows?

1 Answers  


Write a program to show the function of action helper?

1 Answers  


How do you set module name, controller name, and action name in zend framework?

1 Answers  


What is zend engine?

1 Answers  


How to access route, post, get etc. Parameters in zend framework 2?

1 Answers  


What is zend engine in php?

1 Answers  


How can you get a module name in bootstrap file.

1 Answers  


Which version of php does zend framework require?

1 Answers  


Categories