Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Frank Habermann
Hi,

> With which component? Zend_Feed or Zend_Feed_Writer?
I am searching for a solution. So i do not need Zend_Feed. Zend_Feed_Writer is 
also ok ;)

> With the writer you can either a) add a custom extension (see
> Zend_Feed_Writer extensions for examples) or b) get the Entry/Feed's
> DOMElement with getElement() and add it programatically using PHP's DOM
> methods. The second works fine for minor additions. The first exists to
> offer a more friendly API for longer extensions or RSS/Atom modules.
So for me sounds the first solution good. Did you have an small example for an 
extension?

For example i want to have a tag like 'world' in my 
atom feed for each entry. So how could i realize that?

regards,
Frank


Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Pádraic Brady
With which component? Zend_Feed or Zend_Feed_Writer?

With the writer you can either a) add a custom extension (see Zend_Feed_Writer 
extensions for examples) or b) get the Entry/Feed's DOMElement with 
getElement() and add it programatically using PHP's DOM methods. The second 
works fine for minor additions. The first exists to offer a more friendly API 
for longer extensions or RSS/Atom modules.

With Zend_Feed I'm less sure since I haven't used it in a while.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Frank Habermann 
To: fw-general@lists.zend.com
Cc: Pádraic Brady 
Sent: Mon, March 1, 2010 7:11:11 PM
Subject: Re: [fw-general] zend_feed_writer with own namespace

Hi,

> $feed = new Zend_Feed_Writer_Feed;
> // add feed info
> $entry = $feed->createEntry();
> // add entry info
> $feed->addEntry($entry);
> $feedXml = $feed->render('atom');
>
> Anything to do with Zend_Feed_Writer is under that namespace - everything
> else is the older Zend_Feed.
Ok. Thanks for this first. But the question is now: How could i create my own 
tags in my entry with own xml namespace?

regards,
Frank


Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Frank Habermann
Hi,

> $feed = new Zend_Feed_Writer_Feed;
> // add feed info
> $entry = $feed->createEntry();
> // add entry info
> $feed->addEntry($entry);
> $feedXml = $feed->render('atom');
>
> Anything to do with Zend_Feed_Writer is under that namespace - everything
> else is the older Zend_Feed.
Ok. Thanks for this first. But the question is now: How could i create my own 
tags in my entry with own xml namespace?

regards,
Frank


Re: [fw-general] zend_feed_writer with own namespace

2010-03-01 Thread Pádraic Brady
Looks like you're trying to mix Zend_Feed and Zend_Feed_Writer - they are 
separate components as confusing as it looks ;).

Using Zend_Feed_Writer a new entry is created with:

$feed = new Zend_Feed_Writer_Feed;
// add feed info
$entry = $feed->createEntry();
// add entry info
$feed->addEntry($entry);
$feedXml = $feed->render('atom');

Anything to do with Zend_Feed_Writer is under that namespace - everything else 
is the older Zend_Feed.

Paddy

 Pádraic Brady

http://blog.astrumfutura.com
http://www.survivethedeepend.com
OpenID Europe Foundation Irish Representative






From: Frank Habermann 
To: fw-general@lists.zend.com
Sent: Mon, March 1, 2010 1:58:38 PM
Subject: [fw-general] zend_feed_writer with own namespace

Hi,

i want to create an atom feed with some own tags in it.

So i read the doku on:
http://framework.zend.com/manual/en/zend.feed.modifying-feed.html

So i see example2 is good for me. I have an atom entry with own tags.

My problem is now: How could i create a complete feed with zend_feed?

I tried with:
$writer = new Zend_Feed_Writer_Feed();
$entry = new Zend_Feed_Entry_Atom();
$writer->addEntry($entry);

That bring me up an error:
"Catchable fatal error: Argument 1 passed to Zend_Feed_Writer_Feed::addEntry() 
must be an instance of Zend_Feed_Writer_Entry, instance of Zend_Feed_Entry_Atom 
given"

So, how could i create a complete atom feed with own tags?

regards,
Frank