jquery - How to call a javascript function from zend controller indexAction? -


i want call javascript function zend controller indexaction. controller this..

// mycontroller.php

      public function indexaction(){          $role = 'admin';          $id = 23;       // here want call javascript function         /// myjsfun(role, id);        } 

and viwefile controller //index.phtml

    here javascript function     <script type='text/javascript'>     function myjsfun(role, id){     // code function      } 

//mycontroller.php

$role = 'admin'; $id = 23;  $this->view->role = $role; $this->view->id = $id; 

//index.phtml

<script type='text/javascript'>      function myjsfun(role, id){         // code function     }      //actual call:     myjsfun(<?php echo zend_json::encode($this->role) ?>, <?php echo zend_json::encode($this->id) ?>); </script> 

Comments

Popular posts from this blog

django - How can I change user group without delete record -

java - EclipseLink JPA Object is not a known entity type -

java - Need to add SOAP security token -