Prepare Interview

Mock Exams

Make Homepage

Bookmark this page

Subscribe Email Address

Zend Framework Interview Questions and Answers

Ques 11. Zend_Cache provides a generic way to cache any data.

Caching in Zend Framework is operated by frontends while cache records are stored through backend adapters (File, Sqlite,Memcache...) through a flexible system of IDs and tags. Using those, it is easy to delete specific types of records afterwards (for example: "delete all cache records marked with a given tag").
The core of the module (Zend_Cache_Core) is generic, flexible and configurable. Yet, for your specific needs there are cache frontends that extend Zend_Cache_Core for convenience: Output, File, Function and Class.

Is it helpful? Add Comment View Comments
 

Ques 12. Difference between Zend_Registry and Zend_Session?

The basic difference between these objects is the ‘scope’ in which they are valid:

a) Zend_Registry : request scope
b) Zend_Session : session scope

a) Zend_Registry is used to store objects/values for the current request. In short, anything that you commit to Registry in index.php can be accessed from other controllers/actions (because EVERY request is first routed to the index.php bootstrapper via the .htaccess file). Config parameters and db parameters are generally prepped for global use using the Zend_Registry object.

b) Zend_Session actually uses PHP sessions. Data stored using Zend_Session can be accessed in different/all pages. So, if you want to create a variable named ‘UserRole’ in the /auth/login script and want it to be accessible in /auth/redirect, you would use Zend_Session.

Is it helpful? Add Comment View Comments
 

Ques 13. When do we need to disable layout?

At the time of calling AJAX to fetch we need to disable layout.
$this->_helper->layout()->disableLayout();
$this->_helper->viewRenderer->setNoRender(true);

Is it helpful? Add Comment View Comments
 

Ques 14. Where is the model in ZF’s MVC implementation?

The model component can vary dramatically in responsibilities and data store from one MVC application to the next.

Is it helpful? Add Comment View Comments
 

Ques 15. How to call two different views from same action?

Example1:
Public function indexAction() {
If(condition)
$this->render(‘yourview.phtml’);
Else
Index.phtml;

Example2:
Public function indexAction() {
}
Now in your index.phtml you can have this statement to call other view
$this->action(‘action name’,’controller name’,’module name’,array(‘parameter name’=>’parameter value’));

Is it helpful? Add Comment View Comments
 

Most helpful rated by users:

©2024 WithoutBook