Interview Questions

AJAX Interview Questions Android Interview Questions Angular 2 Interview Questions AngularJs Interview Questions Apache Presto Interview Questions Apache Tapestry Interview Questions Arduino Interview Questions ASP.NET MVC Interview Questions Aurelia Interview Questions AWS Interview Questions Blockchain Interview Questions Bootstrap Interview Questions C Interview Questions C Programming Coding Interview Questions C# Interview Questions C++ Interview Questions Cakephp Interview Questions Cassandra Interview Questions CherryPy Interview Questions Clojure Interview Questions Cobol Interview Questions CodeIgniter interview Questions CoffeeScript Interview Questions Cordova Interview Questions CouchDB interview questions CSS Buttons Interview Questions CSS Interview Questions D Programming Language Interview Questions Dart Programming Language Interview Questions Data structure & Algorithm Interview Questions DB2 Interview Questions DBMS Interview Questions Django Interview Questions Docker Interview Questions DOJO Interview Questions Drupal Interview Questions Electron Interview Questions Elixir Interview Questions Erlang Interview Questions ES6 Interview Questions and Answers Euphoria Interview Questions ExpressJS Interview Questions Ext Js Interview Questions F# Interview Questions Firebase Interview Questions Flask Interview Questions Flex Interview Questions Fortran Interview Questions Foundation Interview Questions Framework7 Interview Questions FuelPHP Framework Interview Questions Go Programming Language Interview Questions Google Maps Interview Questions Groovy interview Questions GWT Interview Questions Hadoop Interview Questions Haskell Interview Questions Highcharts Interview Questions HTML Interview Questions HTTP Interview Questions Ionic Interview Questions iOS Interview Questions IoT Interview Questions Java BeanUtils Interview Questions Java Collections Interview Questions Java Interview Questions Java JDBC Interview Questions Java Multithreading Interview Questions Java OOPS Interview Questions Java Programming Coding Interview Questions Java Swing Interview Questions JavaFX Interview Questions JavaScript Interview Questions JCL (Job Control Language) Interview Questions Joomla Interview Questions jQuery Interview Questions js Interview Questions JSF Interview Questions JSP Interview Questions KnockoutJS Interview Questions Koa Interview Questions Laravel Interview Questions Less Interview Questions LISP Interview Questions Magento Interview Questions MariaDB Interview Questions Material Design Lite Interview Questions Materialize CSS Framework Interview Questions MathML Interview Questions MATLAB Interview Questions Meteor Interview Questions MongoDB interview Questions Moo Tools Interview Questions MySQL Interview Questions NodeJS Interview Questions OpenStack Interview Questions Oracle DBA Interview Questions Pascal Interview Questions Perl interview questions Phalcon Framework Interview Questions PhantomJS Interview Questions PhoneGap Interview Questions Php Interview Questions PL/SQL Interview Questions PostgreSQL Interview Questions PouchDB Interview Questions Prototype Interview Questions Pure CSS Interview Questions Python Interview Questions R programming Language Interview Questions React Native Interview Questions ReactJS Interview Questions RequireJs Interview Questions RESTful Web Services Interview Questions RPA Interview Questions Ruby Interview Questions Ruby on Rails Interview Questions SAS Interview Questions SASS Interview Questions Scala Interview Questions Sencha Touch Interview Questions SEO Interview Questions Servlet Interview Questions SQL Interview Questions SQL Server Interview Questions SQLite Interview Questions Struts Interview Questions SVG Interview Questions Swift Interview Questions Symfony PHP Framework Interview Questions T-SQL(Transact-SQL) Interview Questions TurboGears Framework Interview Questions TypeScript Interview Questions UiPath Interview Questions VB Script Interview Questions VBA Interview Questions WCF Interview Questions Web icon Interview Questions Web Service Interview Questions Web2py Framework Interview Questions WebGL Interview Questions Website Development Interview Questions WordPress Interview Questions Xamarin Interview Questions XHTML Interview Questions XML Interview Questions XSL Interview Questions Yii PHP Framework Interview Questions Zend Framework Interview Questions

Top 30 Zend Framework Interview Questions for 2022

1) What is Zend Framework?

Zend is an open source, object-oriented web application framework. It is implemented in PHP 5. It was developed in 3 March 2006.

2) What is the use of front controller in Zend?

Zend front controller is used to manage routing and dispatching. It collects all the requests from the server and handles it.

3) What is the use of Bootstrap?

In Zend Framewrk, Bootstrap is a class that is used to setup initialization and configure of the application.

4) What is Zend auth?

Zend auth provides authentication for the user like admin, general etc.

5) What is application.ini file in Zend Framework?

In Zend Framework, application.ini file is used for configuration of application. This file is located into the application/configs/application.ini location.

6) Does Zend Framework support PHP 4?

No, Zend Framework does support PHP4.

7) When do we need to disable layout in Zend Framework?

In Zend Framework, at the time of calling AJAX to fetch data, we need to disable layout using following steps:
  • $this->_helper->layout()->disableLayout();
  • $this->_helper->viewRenderer->setNoRender(true);

8) Can we call a model in view?

Yes, we can call a model in view.

9) How can we include CSS and view from the controller in Zend Framework?

In Zend Framework, we can include CSS and view from controller by using following steps:
File: $this->headLink()->appendStylesheet('filename.css');  

Controller: $this->view->headLink()->appendStylesheet('filename.css');
And then somewhere in our layout we need to echo our headLink object: headLink();?>

10) How do we set module name, controller name and action name in Zend framework?

In Zend Framework, we can set module, controller and action name by using following code statements:
$request->setModuleName('front');  

$request->setControllerName('address');  

$request->setActionName('addresslist');

11) What are super global variables in Zend framework?

In Zend framework, following are the global variables that we can use in our application.
$request = $this->getRequest();  

$_GET = $request->getParams();  

$_POST = $request->getPost();

12) How can we create model file in zend framework?

We can create model file in zend Framework by using following steps:
class Application_Model_Users extends Zend_Db_Table_Abstract {  

    protected $_name = "users";  

    protected $_primary = "id";        

}

13) What is Front Controller in Zend Framework?

In Zend Framework, front controller are:
  • routeStartup: This function is called before Zend_Controller_Front calls on the router to evaluate the request.
  • routeShutdown: This function is called after the router finishes routing the request.
  • preDispatch: it is called before an action is dispatched by the dispatcher.
  • dispatchLoopStartup: It is used before enters of Zend_Controller_Front.
  • postDispatch: it is called after an action is dispatched by the dispatcher.

14) What is Zend_Form and its features in Zend Framework?

In Zend Framework, Zend_Form is used to create a HTML form. It provides various components like: input, select, radio, and checkbox etc. Following are the features of Zend form.
  • Filtering and validation
  • Ordering
  • Element and Form rendering, including escaping
  • Element aSnd form grouping
  • Element and form-level configuration

15) How can we check whether a form posted or not in Zend framework?

In Zend Framework, we can check whether a form posted or not by using following methods.
$request = $this->getRequest();  

$getData = $request->getParams();  

$postData = $request->getPost();   

$isPost = $request->isPost();

16) How can we get a module name in bootstrap file?

We can get a module name in bootstrap file using following steps:
$request = new Zend_Controller_Request_Http();  

$moduleName = $request->getModuleName();

17) What are the components used in Zend Framework?

Zend Framework components are used to call request & response methods by using its sub-classes.
$request = new Zend_Controller_Request_Http()  

$response = new Zend_Controller_Response_Http()

18) What are Zend Framework MVC and its component?

MVC stands for model view controller. It is an approach that separates the application logic from the presentation. The MVC component are:
  • Model
  • View
  • Controller

19) What are the components of Zend framework?

Zend framework components are:
  • zend-servicemanager
  • zend-eventmanager and
  • zend-modulemanager.

20) What is service manager registration?

Service manager registration is a set of method that used to register a component. Some important methods are given below:
  • Factory method
  • Abstract factory method
  • Initialize method
  • Delegator factory method

21) What are the types of routing in Zend framework?

There are following types of routing in Zend framework:
  • Hostname: It is used to match host part of the URI.
  • Literal: It is used to match exact URI.
  • Method: It is used to match HTTP method of the incoming request.
  • Part: It is used to match the part of the URI path segment using custom logic.
  • Regex: It is used to match the URI path segment by Regex Pattern.

22) How can we create a table in Zend framework?

In Zend framework, we can create a table by using given code:
use tutetable;    

CREATE TABLE book (   

   id int(11) NOT NULL auto_increment,   

   author varchar(100) NOT NULL,   

   title varchar(100) NOT NULL,   

   PRIMARY KEY (id)   

);  

23) How can we install json component in Zend framework?
In Zend framework, we can install json component by using composer. Example:
  1. composer require zendframework/zend-json

24) What are the types of methods of Cookies class in Zend framework?

In Zend framework, there are various methods of Cookies class that are listed in below table:
Cookies Methods Description
addCookie(uri) It is used to add a cookie into the request object of the given URI.
getCookie(cookieName, $cookieForm) It is used to get the cookie, $cookieName available in the given URI
fromResponse(uri) It is used to extract cookies from the response object of the given URI.
isEmpty() It is used to find whether the given Cookie object has any cookie or not.
reset() It is used to clear all the cookies in the given URI.

25) What are the features of Zend framework?

Zend framework features are:
  • Pure object oriented web application framework.
  • Advanced MVC implementation.
  • Supports multi databases Simple cloud API.
  • Session management.
  • Data encryption.
  • Flexible URI Routing.

26) Which protocol is used to send mail in Zend Framework?

In Zend framework, SMPT protocol is used to send mail.

27) Which command is used to debug PHP application in Zend framework?

In Zend framework, echo and die command is used to debug PHP applications.

28) How to implement exchangeArray in Zend framework?

The following code for implement exchangeArray in Zend framework:
<?php   

namespace Employee\Model;   

class Employee {   

   public $id;   

   public $emp_name;   

   public $emp_job;    

   public function exchangeArray($data) {   

      $this->id = (!empty($data['id'])) ? $data['id'] : null;   

      $this->emp_name = (!empty($data['emp_name'])) ? $data['emp_name'] : null;   

      $this->emp_job = (!empty($data['emp_job'])) ? $data['emp_job'] : null;   

   }   

}

29) What is the stable version of Zend framework?

The stable version of zend framework is 3.0.0 and reassessed on 28 june 2016.

30) What are the session components in Zend framework?

In Zend framework, the Session components are given below:
Session Components Descriptions
Zend\Session\Container It is used to read and write API session information.
Zend\Session\SessionManager It is used to manage the entire lifecycle of a session.
Zend\Session\Storage It is used to specify the session data will be stored in the memory.
Zend\Session\SaveHandler It is used to store and retrieve the session data into a physical location..
Zend\Session\Validator It is used to protect session from hijacking.



ADVERTISEMENT
ADVERTISEMENT