我想从 zend 控制器 indexAction 调用一个 javascript 函数。我的控制器看起来像这样..
// mycontroller.php
public function indexAction(){
$role = 'admin';
$id = 23;
// here i want to call the javascript function
/// like myjsfun(role, id);
}
控制器的 viwefile 是 //index.phtml
here is my javascript function
<script type='text/javascript'>
function myjsfun(role, id){
// code for this function
}