Thursday 5 February 2015

Php | Zend Framework Interview Questions And Answers (Part2)

6. I want to use a SQL function or perform calculations in a statement I'm generating with Zend_Db_Select. How can I do this?
Actually, by default, if your expression includes parentheses, Zend_Db_Select will cast the statement appopriately. However, if it does not, or you are having problems, you can useZend_Db_Expr to explicitly create the expression:
* Build the SQL:
* SELECT p."product_id", p.cost * 1.08 AS cost_plus_tax
* FROM "products" AS p
*/
$select = $db->select()
->from(array('p' => 'products'),
array(
'product_id',
'cost_plus_tax' => new Zend_Db_Expr('p.cost * 1.08'),
));

7. Is ZF a component library or a framework?
ZF is both. Zend Framework provides all the components required for most web applications in a single distribution. But Zend Framework components are also loosely coupled, making it easy to use just a few components in a web application- even alongside other frameworks! Using this use-at-will architecture, we are implementing features commonly found in more monolithic frameworks. In fact, we are currently working on a tooling component for the 1.8 release that will make it simpler to build applications using ZF components, yet will not sacrifice the use-at-will nature of existing ZF components. It’s a testament to the use-at-will architecture of Zend Framework that the tooling component itself can be used standalone.

8. What is autoloader?
Autoloader is function that load all the object on start up.

9. What is use of Zend front controller?
Routing and dispatching is managed in the front controller. It collects all the request from the server and handles it.

10. What is the use of Bootstrap?
Apart from index if we want to do any extra configuration regarding database and other things that is done within bootstrap.
More Questions & Answers :-
Part1  Part2  Part3  Part4  Part5

No comments:

Post a Comment