How do call the Controller/action in Zend framework from Javascript such as if(a==b){ } else{ document.myform.action="/fz/controllername/actionname" }
My controllers are located in the src/controllers/
How do call the Controller/action in Zend framework from Javascript such as if(a==b){ } else{ document.myform.action="/fz/controllername/actionname" }
My controllers are located in the src/controllers/
Just call it like any other urls. If I had a news controller and wanted to post there from a form I would just set the form`s action to: '/news' and be done with it.
To expand on this a bit if I had a post action in my news controller I would set
if(a==b){ } else{ document.myform.action="/news/post" }
Since a JS Call is just a regular web call you do it the same way you would access any other Action of your Project, the question is how you handle the output.