blainarmstrong
blainarmstrong

Reputation: 1020

How to get the actual LINK url property from Zend_Feed_Rss channel object

I'm trying to wrap my head around how to use Zend_Feed_Rss. According to the documentation, to get the link of the channel, you access it with the method $channel->link(). But when I do so, I get an array, and the link to the actual thing I want is buried in the SECOND item of the array. What am I doing wrong? The documentation is not very helpful; it seems as if it expects you to just magically figure out how to use this particular method. Also, I've tried googling for other resources but to no avail, so I really need some help here.

Here's the array that I end up getting:

Array
(
    [0] => DOMElement Object
        (
            [tagName] => atom:link
            [schemaTypeInfo] => 
            [nodeName] => atom:link
            [nodeValue] => 
            [nodeType] => 1
            [parentNode] => (object value omitted)
            [childNodes] => (object value omitted)
            [firstChild] => 
            [lastChild] => 
            [previousSibling] => (object value omitted)
            [nextSibling] => (object value omitted)
            [attributes] => (object value omitted)
            [ownerDocument] => (object value omitted)
            [namespaceURI] => http://www.w3.org/2005/Atom
            [prefix] => atom
            [localName] => link
            [baseURI] => /path/to/application
            [textContent] => 
        )

    [1] => DOMElement Object
        (
            [tagName] => link
            [schemaTypeInfo] => 
            [nodeName] => link
            [nodeValue] => http://whatactuallywant.wordpress.com
            [nodeType] => 1
            [parentNode] => (object value omitted)
            [childNodes] => (object value omitted)
            [firstChild] => (object value omitted)
            [lastChild] => (object value omitted)
            [previousSibling] => (object value omitted)
            [nextSibling] => (object value omitted)
            [attributes] => (object value omitted)
            [ownerDocument] => (object value omitted)
            [namespaceURI] => 
            [prefix] => 
            [localName] => link
            [baseURI] => /path/to/applicaiton
            [textContent] => http://whatactuallywant.wordpress.com
        )

    [2] => DOMElement Object
        (
            [tagName] => atom:link
            [schemaTypeInfo] => 
            [nodeName] => atom:link
            [nodeValue] => 
            [nodeType] => 1
            [parentNode] => (object value omitted)
            [childNodes] => (object value omitted)
            [firstChild] => 
            [lastChild] => 
            [previousSibling] => (object value omitted)
            [nextSibling] => (object value omitted)
            [attributes] => (object value omitted)
            [ownerDocument] => (object value omitted)
            [namespaceURI] => http://www.w3.org/2005/Atom
            [prefix] => atom
            [localName] => link
            [baseURI] => /path/to/application
            [textContent] => 
        )

  ...

)

Upvotes: 1

Views: 124

Answers (0)

Related Questions