2008年10月17日星期五

Re: [fw-webservices] ZEND Feed and me trying to paginate it

I use LimitIterator (SPL function - http://www.php.net/~helly/php/ext/spl/classLimitIterator.html) for the exact use case you are describing.

        <ul>
          <?
          foreach (new LimitIterator($rssfeed->getFirstInstanceFeedInstance(), 0, RSS::RSS_ITEM_LIMIT) as $item):
          ?>
          <li><a href="<?=$item->link();?>" target="_blank" title="<?=$item->title()?>"><?=$item->title();?></a></li>
          <?
          endforeach;
          ?>
        </ul>

On Fri, Oct 17, 2008 at 9:28 PM, firecall <alex@diversitygroup.com.au> wrote:

Hi,

I'd thought that ZEND Feed returned an Array object?

But in my wanting to paginate the output id thought I could array_slice it
to get the sequence of entries I want but that doesnt work on the feed
object.

I'd cant seem to do something like: $output = array_slice(Sfeed, 5)


So really what I'm asking is: How would I go about paginating a ZEND Feed
object?

Or how could I manipulate a ZEND_Feed object as an array?


I can output and format the ZEND_Feed object, it's just traversing it and
getting only the entries I want thats confusing me.

My other option is to just use something like http://simplepie.org, but I
have the whole ZEND MVC thing working so wanted to stick withing the ZEND
toolset if I could.

thanks, firecall
--
View this message in context: http://www.nabble.com/ZEND-Feed-and-me-trying-to-paginate-it-tp20043583p20043583.html
Sent from the Zend Web Services mailing list archive at Nabble.com.




--
Cory Wiles
kwylez@gmail.com
http://www.corywiles.com
http://www.400mtogo.com

没有评论: