Zend Framework Interview Questions and Answers

1.What is a Framework?
In software development, a framework is a defined support structure in which another software project can be organized and developed.
- An abstract design
- Set of common functionality
- Developed for a particular domain
2.How to disable layout from controller?
$this->_helper->layout()->disableLayout();
Disable Zend Layout from controller for Ajax call only
if($this->getRequest()->isXmlHttpRequest()){
if($this->getRequest()->isXmlHttpRequest()){
$this->_helper->layout()->disableLayout();
}
3.How to change the View render file from controller?
function listAction(){
function listAction(){
//call another view file file
$this->render(“anotherViewFile”);
}
4.How to protect your site from sql injection in zend when using select query?
$select = $this->select()
$select = $this->select()
from(array(‘u’ => ‘users’), array(‘id’, ‘username’))
where(‘name like ?’,”%php%”)
where(‘user_id=?’,’5′)
where(‘rating<=?’,10);
5.How to check post method in zend framework?
if($this->getRequest()->isPost()){
if($this->getRequest()->isPost()){
//Post
}else{
//Not post
}
Comments
Post a Comment