WordPress.org

Ready to get started?Download WordPress

Plugin Directory

!This plugin hasn't been updated in over 2 years. It may no longer be maintained or supported and may have compatibility issues when used with more recent versions of WordPress.

WP Zend Library

Easy integration of Zend Framework library into WordPress, making it available for themes and other plugins.

Usage

You can use the Zend Framework in both themes and other plugins. Here are some simple examples of its use in a theme context.

Simple Example 1 - Database Query:

<?php
  if(defined('WP_ZEND_LIBRARY')) {

    // display Zend version number
    echo Zend_Version::getLatest();

    if(defined('WP_ZEND_LIBRARY_DB')) {

      // list WordPress usernames
      $results = $db->query('SELECT * FROM wp_users');
      while ($row = $results->fetch()) {
        echo '<p>'.$row['user_login'].'</p>';
      }

    }

  }
?>

Simple Example 2 - Pagination:

<?php
  if(defined('WP_ZEND_LIBRARY')) {

    // Create an array with numbers 1 to 100
    $data = range(1, 100);

    // Get a Paginator object using Zend_Paginator's built-in factory.
    $paginator = Zend_Paginator::factory($data);

    // Select the second page
    $paginator->setCurrentPageNumber(2);

    echo '<ul>';

    // Render each item for the current page in a list-item
    foreach ($paginator as $item) {
        echo '<li>' . $item . '</li>';
    }

    echo '</ul>';

  }
?>

Requires: 3.2 or higher
Compatible up to: 3.2.1
Last Updated: 2011-8-15
Downloads: 1,276

Ratings

5 stars
5 out of 5 stars

Support

Got something to say? Need help?

Compatibility

+
=
Not enough data

0 people say it works.
0 people say it's broken.