Thursday 5 February 2015

Face 2 Face Zend Framework Interview Questions and Answers (Part5)

21. Name some important component in zend framework?
Uses of Zend_Controller
Gives the request & reponse methods by using its sub-classes.
$request = new Zend_Controller_Request_Http()
$response = new Zend_Controller_Response_Http()

Uses of Zend_Date
Date related processing can be done using this component.

Uses of Zend_File_Transfer
it provides extensive support for file uploads and downloads.

Uses of Zend_Db
It is used to doing database related purpose in our appication.

Uses of Zend_Paginator
Doing the pagination in our application.

Uses of Zend_Auth
It is used to authenticate a user.

$auth = Zend_Auth::getInstance();
$results = $auth->authenticate($adapter);
if ($results->isValid()){
/* user successfully authenticate into login process */
}
Zend_Session_Namespace
This is a simple proxy class to use API into the Zend_Session managed $_SESSION Superglobal.

22. 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.

23. 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’));

24. Can we call a model in view?
Yes, you can call a model in view. Simple create the object and call the method.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5

No comments:

Post a Comment