Databases Reference
In-Depth Information
3.4.4 Other Zend Framework components
We have discussed so far only a small portion of the functionalities Zend
Framework provides. As mentioned previously, the framework fulfills the
promises and provides a rich set of components to build today's applications
quickly. In this section, we briefly go through some of these components. We
recommend that you refer to the Zend online manual for the details and
examples.
Zend_Feed
RSS & Atom feeds are hot technologies today and many applications are being
built to support them. RSS/Atom is a technology and syndication is a process.
Feed is about getting content regularly and sequentially. The core technology is
XML on which both are built, and hence, DB2 9 pureXML can be used to store
RSS/Atom feeds. XCS makes this job even easier. Zend_Feed provides a natural
syntax for accessing elements of feeds, feed attributes, and entry attributes.
Zend_Feed also has extensive support for modifying the feed and entry structure
with the same natural syntax and turning the result back into XML. In the future,
this modification support could provide support for the Atom Publishing Protocol.
The Zend online documentation shows an example to demonstrate a simple use
case of retrieving an RSS feed and saving relevant portions of the feed data to a
simple PHP array, which you could then use for printing the data, storing to a
database, and so on.
Zend_Mail
Zend_Mail provides generalized functionality to compose and send both text and
MIME-compliant e-mail messages.You can send mail with Zend_Mail via the php
built-in mail() function or via direct SMTP connection. Different options can also
be used such as sending HTML e-mail or sending attachments with e-mail. A
simple e-mail consists of some recipients, a subject, a body, and a sender. To
send mail using the Zend_Mail API, follow Example 3-39.
Example 3-39 Using Zend_Mail API to send e-mail
<?php
require_once 'Zend/Mail.php';
$mail = new Zend_Mail();
$mail → setBodyText('DB2 Express-C ROCKS with PHP !!');
//to send html email use setBodyHtml() instead of setBodytext()
//the MIME content type will be automatically set to html
$mail → setBodyHtml('<b>DB2 Express-C </b>ROCKS with PHP !!');
//to send attachment use addAttachment()
//by default it assume binary attachment, but second argument
//can override this to image
$mail → addAttachment($someBinaryString);
Search WWH ::




Custom Search