Using REST web services with ZendRest 1
At the start of this chapter, we mentioned that the various Zend Framework components we'd be working with would include XML but that we wouldn't be needing to deal with it directly. The Zend_Rest section of the manual opens by stating that REST Web Services use service-specific XML formats, which is true, but it needs a little clarification because REST web services don't care whether or not they use XML. Zend_ Rest does use XML as its format of choice, but it's possible to circumvent this if...
Adding images to the page
Adding images to your PDF document starts by loading your image file, which must be in TIFF, PNG, or JPEG format, passing its full path to the Zend_Pdf_Image image-WithPath method, then adding it to the page like so image page- gt drawImage image, x1, y1, x2, y2 The x and y values here are the same as you'd use for drawing a rectangle. Your image will be stretched to fit the specified size if it isn't the same as, or proportional to, the original image size. If you need to load alternative...
C Case sensitivity
Zend Framework's router and dispatcher are sensitive to the case of action and controller names. This is for a very good reason PHP's function and method names aren't case sensitive, but filenames generally are. This means that there are rules when using capital letters or other word separators as controller names to ensure that the correct class files can be found. For action names, it's important that the correct view script can be found. The following subsections outline the rules for...
Listing B Using iteration with Zend Db Table Rowset
class Users extends Zend_Db_Table users new Users userRowset users- gt fetchAll lt foreach userRowset as user lt echo user- gt name . n Defines gateway class to Users database table As we'd expect, using a rowset is as easy as using an array. This is possible because Zend_Db_Table_Rowset_Abstract implements the Iterator SPL interface, as shown in listing B.12.
Translating with ZendTranslate
As we've already seen, website translation requires, at a minimum, ensuring that every string that is displayed has a translated version. The most common way to do this is with gettext , which is powerful but fairly complicated. Zend_Translate supports the gettext format but also supports other popular formats such as arrays, CSV, TBX, Qt, XLIFF, and XmlTm. Zend_Translate is also thread-safe, which can be very helpful if you're running a multithreaded web server, such as IIS. Zend_Translate...
Whats in it
Zend Framework is composed of many distinct components that can be grouped into six top-level categories. Because it is a complete framework, you have everything you need to build enterprise-ready web applications. However, the system is very flexible and has been designed so that you can pick and choose to use those bits of the framework that are applicable to your situation. Following on from the high-level overview shown earlier in figure 1.3, figure 1.4 lists the main components within each...
Implementing authentication 1
Let's look at how to implement authentication with Zend_Auth using HTTP authentication, and then we'll look at how authentication is implemented within a real-world application using a database to hold the user information and sessions to store the information across multiple page views. The Zend_Auth component is the part of the framework that deals with authentication. It's separated into the core component and a set of authentication adapters. The adapters contain the actual mechanisms for...


