InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Kind Of Contribution Requires That I Submit A Cla? And What Kind Of Contribution Can I Make Without Submitting A Cla? |
|
Answer» You must sign a (LA before ZEND Framework can accept any content that constitutes Intellectual property. This Includes anything that could carry a copyright or be PATENTED. This includes CODE, patches, tests, documentation, and even proposals SUBMITTED on our wiki. You do not need to submit a CIA to report a bug or make a feature request in our issue tracker, or to ask a question on the mailing lists, You can Include code In EMAILS to the mailing lists to Illustrate your words, but your code cannot be incorporated into Zend Framework unless it Is submitted under the terms of the CLA. You must sign a (LA before Zend Framework can accept any content that constitutes Intellectual property. This Includes anything that could carry a copyright or be patented. This includes code, patches, tests, documentation, and even proposals submitted on our wiki. You do not need to submit a CIA to report a bug or make a feature request in our issue tracker, or to ask a question on the mailing lists, You can Include code In emails to the mailing lists to Illustrate your words, but your code cannot be incorporated into Zend Framework unless it Is submitted under the terms of the CLA. |
|
| 2. |
I've Submitted The Cla Now How Can I Get Started Contributing To Zend Framework? |
|
Answer» There are lots of WAYS to contribute to Zend Framework. Many MAJOR features are contributed to ZF through our proposal process. Most code contributors also commit bug fixes and tests. Another valuable form of contribution is manual translation and other forms of documentation. Contributors may also invest their TIME in updating the wiki or adding, commenting on, and VOTING on Issues in our Issue tracker. No matter how you plan to contribute, the best place to get started is our contributor guide. There are lots of ways to contribute to Zend Framework. Many major features are contributed to ZF through our proposal process. Most code contributors also commit bug fixes and tests. Another valuable form of contribution is manual translation and other forms of documentation. Contributors may also invest their time in updating the wiki or adding, commenting on, and voting on Issues in our Issue tracker. No matter how you plan to contribute, the best place to get started is our contributor guide. |
|
| 3. |
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? |
|
Answer» Actually, by DEFAULT, If your expression Includes parentheses, Zend Db Select will cast the statement APPROPRIATELY. However, If It does not, oryou are having problems, you can use Zend_Db_Exprto explicitly create the expression: /‘ Build the SQL: * SELECT p.”product_jd”, 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 * l.08’), ));Actually, by default, If your expression Includes parentheses, Zend Db Select will cast the statement appropriately. However, If It does not, oryou are having problems, you can use Zend_Db_Exprto explicitly create the expression: |
|
| 4. |
How Can I Add Extra Html (such As A Link) To My Form Element? |
|
Answer» This can easily be done using decorators. For instance using the Description DECORATOR. It is important to note though that you will need to turn off escaping for the output of the decorator: $element->setDecorators(array( array(‘ViewHe/per’), array(‘Description’,array(‘ESCAPE’, false)), array(‘Errors’), array(‘HTMLTAG’, array(‘tag’=>’dd’)), arrar(‘Lable’, array(‘tag’=>’dt’)), ));Now, you can use the following to add EXTRA HTML to the element: $element->setDescription(’<strong>This CONTAINS HT%1L that will actually be parsed by the browser, not escaped</strong>’); This can easily be done using decorators. For instance using the Description decorator. It is important to note though that you will need to turn off escaping for the output of the decorator: Now, you can use the following to add extra HTML to the element: $element->setDescription(’<strong>This contains HT%1L that will actually be parsed by the browser, not escaped</strong>’); |
|
| 5. |
How Can I Detect If An Optional File Has Been Uploaded? |
|
Answer» The receive() METHOD will return true for file elements that are not required. The reason is that you said “the file can be omitted, and that’s ok for me”. The receive() method will return false only in the event of a failure. Still there are several ways to detect if a file has been uploaded or not:
The receive() method will return true for file elements that are not required. The reason is that you said “the file can be omitted, and that’s ok for me”. The receive() method will return false only in the event of a failure. Still there are several ways to detect if a file has been uploaded or not: |
|
| 6. |
How Can I Make All I'll 8n-aware Components Aware Of My Zend_translate Object? |
|
Answer» A VARIETY of components are translation AWARE (i.e., ACCEPT Zend_Translate objects), including: Zend_View_Helper_Translate Zend_Validate_* Zend_FormTo have them all use the same Zend_Translate instance, simply place it in the REGISTRY with the key “Zend_Translate”: Zend_Registry::set(‘Zend_Translate’, $translate);A variety of components are translation aware (i.e., accept Zend_Translate objects), including: To have them all use the same Zend_Translate instance, simply place it in the registry with the key “Zend_Translate”: |
|
| 7. |
How Can I Use The Same Locale Everywhere? |
|
Answer» With ZF 1.7 an APPLICATION wide locale is supported. You can do the following in your bootstrap FILE: $locale = new Zend_Locale(’en’); Zend_Registry::set(’Zend_Locale $locaIe;From now on, all locale aware COMPONENTS will use your locale object STORED in the registry as long as you don’t give another one manually. With ZF 1.7 an application wide locale is supported. You can do the following in your bootstrap file: From now on, all locale aware components will use your locale object stored in the registry as long as you don’t give another one manually. |
|
| 8. |
Why Are My Dates Formatted Wrong? Why Do I Get The False Year Value? |
|
Answer» When using own formats in your code you could come to a situation where you get for EXAMPLE 29.1 2.2009, but you expected to get 29.1 2.2008. There is one year difference: 2009 instead of 2008. You should USE the lower cased year CONSTANT. See this example: $date- >toString(dd.MM.yy);NOTE the lower cased “y” which makes the difference and outputs the REAL year. When using own formats in your code you could come to a situation where you get for example 29.1 2.2009, but you expected to get 29.1 2.2008. There is one year difference: 2009 instead of 2008. You should use the lower cased year constant. See this example: Note the lower cased “y” which makes the difference and outputs the real year. |
|
| 9. |
How Can I Debug Zend_date In A Simple Way? |
|
Answer» When you think that you are getting wrong OUTPUT from Zend_Date then it’s often needed to see what Zend_Date really uses internally. Well., a var_dump of Zend_Date is not really helpful,l but you could simply use getIso(). This format has all date inform actions AVAILABLE: Note that using toString() and outputting only parts of a date does not show all needed information’s. There could be a wrong used timezone, or a DST change which is suppressed by toString() but shown with getIso(). When you think that you are getting wrong output from Zend_Date then it’s often needed to see what Zend_Date really uses internally. Well., a var_dump of Zend_Date is not really helpful,l but you could simply use getIso(). This format has all date inform actions available: Note that using toString() and outputting only parts of a date does not show all needed information’s. There could be a wrong used timezone, or a DST change which is suppressed by toString() but shown with getIso(). |
|
| 10. |
How Can I Retrieve The View Object Within A Plugin Or Arbitrary Code? |
|
Answer» ZF uses an ACTION helper called the ViewRenderer by default. This action helper instantiates and STORES a Zend_view object which is subsequently injected into other objects. The view object is stored in the ViewRenderer’s view property. You can get the ViewRenderer instance, and thereby the view instance, with the Action Helper broker: $vsewRenderer Zend,, Conrroller,,A ction_HelperBroke::getStaticHelper(viewRenderer); $view =$viewRenderer-->viewHowever, if you’re accessing the view early in the dispatch process- before an action is actually dispatched, for example- then you may need to initialize the view first if (!isset($viewRenderer->view)) { $viewRendere-->intViewO(); } $vi ew = Svi ewRenderer-- >view;If you are USING and have already initialized Zend_Layout, you can ACCESS the view object much more succinctly: $view = Zend_Layo ut::getMvcInstance()-- >getView();This proxies to the ViewRenderer and performs all of the steps above for you. ZF uses an action helper called the ViewRenderer by default. This action helper instantiates and stores a Zend_view object which is subsequently injected into other objects. The view object is stored in the ViewRenderer’s view property. You can get the ViewRenderer instance, and thereby the view instance, with the Action Helper broker: $vsewRenderer Zend,, Conrroller,,A ction_HelperBroke::getStaticHelper(viewRenderer); However, if you’re accessing the view early in the dispatch process- before an action is actually dispatched, for example- then you may need to initialize the view first If you are using and have already initialized Zend_Layout, you can access the view object much more succinctly: This proxies to the ViewRenderer and performs all of the steps above for you. |
|
| 11. |
I'm Using The Contextswitch Or Ajaxcontext View Helper And Receiving An Exception Indicating The Error.ajax.phtml View Script Is Missing What Am I Doing Wrong? |
|
Answer» ContextSwitch makes the assumptions that
If you see the above error; your code is throwing an exception - but the context is still in PLAY, and the ViewRenderer is simply trying to load a view script for the current context from the ErrorController. The easiest way to fix the SITUATION is to have the ErrorController::errorAction() redefine the view script SUFFIX, as follows: CLASS ErrorController extends Zend_Controller_Action { public function errorAction() { $this->_helper->viewRenderer->setViewSuffix(’phtml’); //… } }ContextSwitch makes the assumptions that If you see the above error; your code is throwing an exception - but the context is still in play, and the ViewRenderer is simply trying to load a view script for the current context from the ErrorController. The easiest way to fix the situation is to have the ErrorController::errorAction() redefine the view script suffix, as follows: |
|
| 12. |
I'm Using Apache, And Passing Urlencoded Slashes Via $_get Or As Url Parameters - And I'm Getting 4o4s' |
|
Answer» APACHE by default disallows urlencoded slashes (I.e., %2F”) In IJRL path parts or the query string. This feature can be DISABLED by enabling the “AllowEncodedS lashes’ directive: AllowEncodedSlashes On However, this directive MUST be set at either a seiver-wide (httpd.conf) or virtual-host level. Apache by default disallows urlencoded slashes (I.e., %2F”) In IJRL path parts or the query string. This feature can be disabled by enabling the “AllowEncodedS lashes’ directive: AllowEncodedSlashes On However, this directive must be set at either a seiver-wide (httpd.conf) or virtual-host level. |
|
| 13. |
What Is Lucene? |
|
Answer» Lucene is a high-performance, full-featured text search engine that utilizes an open, BINARY FORMAT for storing search indexes and a standardized query format for querying against the indexes. Lucene was originally written in JAVA as part of the APACHE project. Zend_Search_Lucene is a PHP implementation that PROVIDES full binary compatibility with Java Lucene. Lucene is a high-performance, full-featured text search engine that utilizes an open, binary format for storing search indexes and a standardized query format for querying against the indexes. Lucene was originally written in java as part of the Apache project. Zend_Search_Lucene is a PHP implementation that provides full binary compatibility with Java Lucene. |
|
| 14. |
Can I Use Zend_search_lucene To Search My Java Lucene-generated Indexes? |
|
Answer» YES! In fact, the Zend Framework site USES Zend_Search_Lucene with indexes created by our java DEVELOPER tools to provide site-wide SEARCH. Yes! In fact, the Zend Framework site uses Zend_Search_Lucene with indexes created by our java developer tools to provide site-wide search. |
|
| 15. |
Why Are Client Libraries For Web Services Such As Akismet, Amazon, Audioscrobbler, Delicious, Flickr, Nirvanix, Simply, Strikeiron, And Yahoo! Part Of The Zend Framework Standard Library? |
|
Answer» Zend Framework has been designed to solve the most common problems in web APPLICATION development. Web services are a BIG part of today’s web development environment, So much so that many of our users CONSUME our web service CLIENTS for services such as Amazon ECS, Akismet, and ReCaptcha before adopting more infrastructure-oriented components such as Zend_Registry and Zend_Log. Because these web services PLAY such an important role in today’s web applications, we consider them ‘first-class citizens’ in ZF. Zend Framework has been designed to solve the most common problems in web application development. Web services are a big part of today’s web development environment, So much so that many of our users consume our web service clients for services such as Amazon ECS, Akismet, and ReCaptcha before adopting more infrastructure-oriented components such as Zend_Registry and Zend_Log. Because these web services play such an important role in today’s web applications, we consider them ‘first-class citizens’ in ZF. |
|
| 16. |
I've Tried Sending An 'unsubscribe' Mail To All Zf Mailing Lists, But I'm Still Getting Messages From These Lists. What Do I Have To Do To Stop Getting These Mails? |
|
Answer» There is an ‘fw-all’ list that aggregates all other LISTS besides 1w-announce, fw- general, fw- docs, and fw- svn. Please try sending an email to IW-all-subscribe@lists.zend.com to make sure you’re not subscribed to this list Also, please ensure that you mail all UNSUBSCRIBE REQUESTS from the ACCOUNT that you subscribed with. You may be receiving list traffic on a different account if you have set up a mail forward from the ORIGINAL subscription account. There is an ‘fw-all’ list that aggregates all other lists besides 1w-announce, fw- general, fw- docs, and fw- svn. Please try sending an email to IW-all-subscribe@lists.zend.com to make sure you’re not subscribed to this list Also, please ensure that you mail all unsubscribe requests from the account that you subscribed with. You may be receiving list traffic on a different account if you have set up a mail forward from the original subscription account. |
|
| 17. |
What Services Are Available From Zend Technologies For Zend Framework? |
|
Answer» ZEND Technologies provides a comprehensive set of services for Zend Framework, INCLUDING:
Zend Technologies provides a comprehensive set of services for Zend Framework, including: |
|
| 18. |
A New Zend Framework Release? Why? |
|
Answer» We’ve examined ZFI from the view point of its architecture, as well as the use cases developers have ADOPTED. In many cases, we simply cannot support existing use cases, or the architecture needs to change in order to do so. Additionally, since ZFI grew very organically, there are many PLACES where similar solutions to similar problems are inconsistent, leading to difficulty educating developers. In Zend Framework 2 we’ve used a consistent set of coding patterns and practices and we’ve TAKEN into account the GENERALLY acknowledged best practices for writing efficient reliable, and high-performing software. We’ve examined ZFI from the view point of its architecture, as well as the use cases developers have adopted. In many cases, we simply cannot support existing use cases, or the architecture needs to change in order to do so. Additionally, since ZFI grew very organically, there are many places where similar solutions to similar problems are inconsistent, leading to difficulty educating developers. In Zend Framework 2 we’ve used a consistent set of coding patterns and practices and we’ve taken into account the generally acknowledged best practices for writing efficient reliable, and high-performing software. |
|
| 19. |
What New Features Will I Find In Zend Framework 2? |
|
Answer» Some highlights:
Some highlights: |
|
| 20. |
What's The Release Schedule For Zend Framework 2? |
|
Answer» Zend Framework 2 BETA 3 is the CURRENT release. There will be a feature-complete beta in spring 2012. Official general availability is PLANNED for summer 2012. Zend Framework 2 Beta 3 is the current release. There will be a feature-complete beta in spring 2012. Official general availability is planned for summer 2012. |
|
| 21. |
Does This Mean That Zend Framework 1 Is About To Be End-of-lifed? |
|
Answer» DEFINITELY not! We CURRENTLY PLAN to fully support Zend Framework I until at least early 20 14, including maintenance and security UPDATES. Definitely not! We currently plan to fully support Zend Framework I until at least early 20 14, including maintenance and security updates. |
|
| 22. |
I'm Starting A New Project - Which Version Of Zend Framework Should I Use? |
|
Answer» If the PROJECT will complete mid-2012 or later, start using ZEND Framework 2! The current beta 3 is a great opportunity to begin acquainting yourself with the main FEATURES, and the feature-complete beta 4 and GA RELEASES will follow QUICKLY. If the project will complete mid-2012 or later, start using Zend Framework 2! The current beta 3 is a great opportunity to begin acquainting yourself with the main features, and the feature-complete beta 4 and GA releases will follow quickly. |
|
| 23. |
What Version Of Php Is Zend Framework 2 Based On? |
|
Answer» ZEND Framework 2 Is BASED on PHP 5.3. We expect to ADD SUPPORT For PHP 5.4 once it starts to be adopted by the PHP COMMUNITY. Zend Framework 2 Is based on PHP 5.3. We expect to add support For PHP 5.4 once it starts to be adopted by the PHP community. |
|
| 24. |
What Is The Difference Between Zend_auth And Zend_aci? |
|
Answer» Zend Auth is used for authenticating users with variety of authentication methods, including LDAP, OpeniD, and HTTP, Authentication is the process of verifying that the PROVIDED credentials are VALID for the system. By authenticating to your system, your users can prove that they are who they say they are. For more information on Zend Framework’s authentication implementation, SEE the Zend_Auth documentation. Zend_Acl is an implementation of ACCESS Control List (ACL) authorization. Generally speaking, ACLs are lists of roles that are authorized to perform a particular operation on SPECIFIC resources in your system. Zend_AcI can support advanced rule definitions with features such as multiple inheritance for roles and assertions for conditional rules. For more information on Zend_AcI, see the Zend_AcI documentation. Zend Auth and Zend_AcI can be used together to build very sophisticated security systems: first the user confirms their Identity with Zend_Auth, then this Identity is used to assign one or more Zend_AcI roles to the user for authorization to use or modify resources in the system. Zend Auth is used for authenticating users with variety of authentication methods, including LDAP, OpeniD, and HTTP, Authentication is the process of verifying that the provided credentials are valid for the system. By authenticating to your system, your users can prove that they are who they say they are. For more information on Zend Framework’s authentication implementation, see the Zend_Auth documentation. Zend_Acl is an implementation of Access Control List (ACL) authorization. Generally speaking, ACLs are lists of roles that are authorized to perform a particular operation on specific resources in your system. Zend_AcI can support advanced rule definitions with features such as multiple inheritance for roles and assertions for conditional rules. For more information on Zend_AcI, see the Zend_AcI documentation. Zend Auth and Zend_AcI can be used together to build very sophisticated security systems: first the user confirms their Identity with Zend_Auth, then this Identity is used to assign one or more Zend_AcI roles to the user for authorization to use or modify resources in the system. |
|
| 25. |
What Do I Have To Do To Contribute To Zend Framework? |
|
Answer» The only REQUIREMENT for contributing to Zend Framework is submitting our either our Individual Contributors License Agreement ((LA) or our corporate CLA. Once you have signed the CL you can visit our contributors wiki to get started. We STRONGLY recommend you read and understand the terms of our NEW BSD License-style license, under which all parts of Zend Framework are licensed, all contributions INCLUSIVE. The only requirement for contributing to Zend Framework is submitting our either our Individual Contributors License Agreement ((LA) or our corporate CLA. Once you have signed the CL you can visit our contributors wiki to get started. We strongly recommend you read and understand the terms of our New BSD License-style license, under which all parts of Zend Framework are licensed, all contributions inclusive. |
|
| 26. |
About Zend Framework? |
|
Answer» Extending the art & spirit of PHP, Zend Framework Is based on simplicity, object-oriented best practices, corporate Friendly LICENSING, and a rigorously tested agile codebase, Zend Framework Is Focused on building more secure, reliable, and modern Web 2.0 applications &web services, and consuming WIDELY AVAILABLE APIs from leading vendors like Google, AMAZON, Yahoo. Flickr as well as API PROVIDERS and cataloguers like Strike iron and ProgrammableWeb. Extending the art & spirit of PHP, Zend Framework Is based on simplicity, object-oriented best practices, corporate Friendly licensing, and a rigorously tested agile codebase, Zend Framework Is Focused on building more secure, reliable, and modern Web 2.0 applications &web services, and consuming widely available APIs from leading vendors like Google, Amazon, Yahoo. Flickr as well as API providers and cataloguers like Strike iron and ProgrammableWeb. |
|
| 27. |
I Want To Use A Sql Function Or Perform Calculations In A Statement Fm Generating With Zend_db_select. How Can I Do This? |
|
Answer» Actually, by default. if your expression includes parentheses, Zend_Db_Select will cast the STATEMENT appropriately. However, if it does not, or you are having PROBLEMS, you can use Zend_Db_Expr to explicitly create the expression: * BUILD the SQL: SELECT p.product_Jd p.cost 1.08A5 costp/us_tax * FROM “products”AS p $se/ect $db->se/ect() ->from(array(‘p’=>‘products’), array( ‘product_id’, ‘cost_p/us_ TAX’>NEW Zendj2b_Expr(’p.cost*1.08), ));Actually, by default. if your expression includes parentheses, Zend_Db_Select will cast the statement appropriately. However, if it does not, or you are having problems, you can use Zend_Db_Expr to explicitly create the expression: |
|
| 28. |
What Is Front Controller? |
|
Answer» It used Front Controller pattern. ZEND also use SINGLETON pattern.
It used Front Controller pattern. zend also use singleton pattern.
|
|
| 29. |
Should I Sign An Individual Cla Or A Corporate Cla? |
|
Answer» If you are contributing code as an INDIVIDUAL- and not as PART of your job at a company- you should sign the individual CLA. If you are contributing code as part of your responsibilities as an employee at a company, you should SUBMIT a corporate CLA with the names of all co-workers that you foresee contributing to the PROJECT. If you are contributing code as an individual- and not as part of your job at a company- you should sign the individual CLA. If you are contributing code as part of your responsibilities as an employee at a company, you should submit a corporate CLA with the names of all co-workers that you foresee contributing to the project. |
|
| 30. |
Why Does The Zend Framework Project Have A Cla At All? |
|
Answer» The CLA PROTECTS all users including INDIVIDUALS, small and medium businesses, and large CORPORATIONS. By having a CLA in place, we mitigate the risk that companies who claim intellectual property infringement MAY demand royalties or fees from users of Zend FRAMEWORK, whether individuals or companies. This is especially important for companies basing their business or products on Zend Framework. The Zend Framework CLA helps to ensure that code and other IP in Zend Framework remains free. The CLA protects all users including individuals, small and medium businesses, and large corporations. By having a CLA in place, we mitigate the risk that companies who claim intellectual property infringement may demand royalties or fees from users of Zend Framework, whether individuals or companies. This is especially important for companies basing their business or products on Zend Framework. The Zend Framework CLA helps to ensure that code and other IP in Zend Framework remains free. |
|
| 31. |
How Can I Customize The Appearance Of Forms Generated By Zend_form? |
|
Answer» You’re probably looking for decorators. All forms and form ELEMENTS in Zend_Form USE decorators to RENDER their output. You’re probably looking for decorators. All forms and form elements in Zend_Form use decorators to render their output. |
|
| 32. |
Why Can't Zend_form Render My File Element Without Errors? |
|
Answer» The file element needs a SPECIAL file decorator, which is added by default. When you set your own decorators for file ELEMENTS, you DELETE the default decorators. For EXAMPLE: $element->setDecorators(array( array(‘ViewHelper’), array(‘Errors’) ));You should USE a File decorator instead of the ViewHelper for the file element, like so: $element->setDecorators(array( array(‘File’), array(‘Errors’) ));The file element needs a special file decorator, which is added by default. When you set your own decorators for file elements, you delete the default decorators. For example: You should use a File decorator instead of the ViewHelper for the file element, like so: |
|
| 33. |
Features Of Mvc In Zend Framework? |
Answer»
|
|
| 34. |
How To Include Css From Controller And View In Zend? |
|
Answer» From WITHIN a view file: $this->headLink()->appendStylesheet(‘filename.css’); From within a view file: $this->headLink()->appendStylesheet(‘filename.css’); |
|
| 35. |
Zend_cache Provides A Generic Way To Cache Any Data |
|
Answer» 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. 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. |
|
| 36. |
What Are Plugins In Zend Framework? |
Answer»
Creating Plugins: Creating Plugins: |
|
| 37. |
What Is Routing And How It's Work? |
|
Answer» Zend_Controller_Router_Rewrite is the standard framework router. Routing is the process of taking a URI endpoint (that part of the URI which comes after the base URL) and decomposing it into parameters to determine which module, CONTROLLER, and action of that controller should receive the request. This values of the module, controller, action and other parameters are packaged into a Zend_Controller_Request_Http object which is then processed by Zend_Controller_Dispatcher_Standard. Routing occurs only once: when the request is initially received and before the FIRST controller is dispatched. Zend_Controller_Router_Rewrite is designed to allow for mod_rewrite-like functionality using pure PHP structures. It is very loosely based on Ruby on Rails routing and does not require any prior KNOWLEDGE of webserver URL rewriting. It is designed to work with a SINGLE Apache mod_rewrite rule. Zend_Controller_Router_Rewrite is the standard framework router. Routing is the process of taking a URI endpoint (that part of the URI which comes after the base URL) and decomposing it into parameters to determine which module, controller, and action of that controller should receive the request. This values of the module, controller, action and other parameters are packaged into a Zend_Controller_Request_Http object which is then processed by Zend_Controller_Dispatcher_Standard. Routing occurs only once: when the request is initially received and before the first controller is dispatched. Zend_Controller_Router_Rewrite is designed to allow for mod_rewrite-like functionality using pure PHP structures. It is very loosely based on Ruby on Rails routing and does not require any prior knowledge of webserver URL rewriting. It is designed to work with a single Apache mod_rewrite rule. |
|
| 38. |
What Is Zend Engine In Php? |
|
Answer» Zend ENGINE is like a virtual machine and is an OPEN SOURCE, and is known for its role in automating the web using PHP. Zend is named after its developers Zeev and Aandi. Its reliability, performance and extensibility has a significant role in increasing the PHP’s popularity. The Zend Engine II is the heart of PHP 5. It is an open source project and freely available under BSD style license. Zend engine is like a virtual machine and is an open source, and is known for its role in automating the web using PHP. Zend is named after its developers Zeev and Aandi. Its reliability, performance and extensibility has a significant role in increasing the PHP’s popularity. The Zend Engine II is the heart of PHP 5. It is an open source project and freely available under BSD style license. |
|
| 39. |
What Is Zend Engine? |
|
Answer» Zend ENGINE is used internally by PHP as a compiler and RUN TIME engine. PHP Scripts are loaded into memory and COMPILED into Zend opcodes. Zend Engine is used internally by PHP as a compiler and run time engine. PHP Scripts are loaded into memory and compiled into Zend opcodes. |
|
| 40. |
What Is Bootstrapping? |
|
Answer» Many PHP applications funnel server requests into a single (or few) PHP source file that sets up the environment and configuration for the APPLICATION, manages SESSIONS and CACHING, and invokes the dispatcher for their MVC framework. They can do more, but their main job is to take care of the consistent needs of every page of a web application. In our Blueprint for PHP Applications, we will have a core bootstrapper that receives all DYNAMIC requests for an application and applies a template for application behavior that we can later extend. It will allow us to later customize the functionality for each UNIQUE application. Many PHP applications funnel server requests into a single (or few) PHP source file that sets up the environment and configuration for the application, manages sessions and caching, and invokes the dispatcher for their MVC framework. They can do more, but their main job is to take care of the consistent needs of every page of a web application. In our Blueprint for PHP Applications, we will have a core bootstrapper that receives all dynamic requests for an application and applies a template for application behavior that we can later extend. It will allow us to later customize the functionality for each unique application. |
|
| 41. |
Why Should We Use Framework? |
|
Answer» Framework is a structured SYSTEM Framework is a structured system |
|
| 42. |
How Can You Get A Module Name In Bootstrap File? |
|
Answer» ANSWER : $ROUTER = new Zend_Controller_Router_Rewrite(); $REQUEST = new Zend_Controller_Request_Http(); $router->ROUTE($request); $moduleName = $request->getModuleName(); |
|
| 43. |
How Do You Protect Your Site From Sql Injection In Zend When Using Select Query? |
|
Answer» You have to quote the strings, $this->getAdapter ()->quote (<VARIABLE name ); $select->where (”<field name> = “,<variable name> ); OR (If you are using the QUESTION mark after equal to sign) $select->where (”<field name> = ? “, <variable name>);
You have to quote the strings,
|
|
| 44. |
How To Include Css From Controller And View In Zend |
|
Answer» From WITHIN a VIEW file: $this->headLink()->appendStylesheet(‘filename.css’); And then SOMEWHERE in your layout you need to echo out your headLink OBJECT: headLink();?> From within a view file: $this->headLink()->appendStylesheet(‘filename.css’); And then somewhere in your layout you need to echo out your headLink object: headLink();?> |
|
| 45. |
How To Include Js From Controller And View In Zend |
|
Answer» From WITHIN a view FILE: $this->headScript()->appendFile(‘filename.js’); And then SOMEWHERE in your layout you NEED to ECHO out your headScript object: headScript();?> From within a view file: $this->headScript()->appendFile(‘filename.js’); And then somewhere in your layout you need to echo out your headScript object: headScript();?> |
|
| 46. |
Can We Move The Index.php File Outside The Public Folder? |
|
Answer» yes you can move index.php FILE OUTSIDE the PUBLIC folder. yes you can move index.php file outside the public folder. |
|
| 47. |
Can We Rename The Application Folder ? |
|
Answer» YES you can RENAME the APPLICATION FOLDER. yes you can rename the application folder. |
|
| 48. |
How Do U Define The Library Path In Zend ? |
|
Answer» create DIRECTORY ‘library’, and put ‘Zend’ directory in it. Your directory structure will look like this: wwwroot now you should ADD library to your include path. Edit index.php FILE: $includePath = array(); $includePath[] = ‘.’; $includePath[] = ‘./../application’; $includePath[] = ‘./../library’; $includePath[] = get_include_path(); $includePath = implode(PATH_SEPARATOR,$includePath); set_include_path($includePath);create directory ‘library’, and put ‘Zend’ directory in it. Your directory structure will look like this: wwwroot now you should add library to your include path. Edit index.php file: |
|
| 49. |
How Do U Set Module Name, Controller Name, And Action Name In Zend Framework? |
| Answer» | |
| 50. |
Where's The Model? |
|
Answer» Unlike the view and the controller components, the model component can vary dramatically in responsibilities and data storage from one MVC application to the NEXT. It should represent what your application does in the abstract. The Zend Framework community has not defined a model interface, class, or other formalism because we haven't identified ENOUGH added value to justify limitations on what constitutes a model. Unlike the view and the controller components, the model component can vary dramatically in responsibilities and data storage from one MVC application to the next. It should represent what your application does in the abstract. The Zend Framework community has not defined a model interface, class, or other formalism because we haven't identified enough added value to justify limitations on what constitutes a model. |
|