A package to easily generate an Atom feed.

0.2.4 2020-12-29 14:00 UTC

This package is auto-updated.

Last update: 2022-06-29 02:05:58 UTC


Build status StyleCI Status Code coverage Total Downloads Latest Stable Version License

This package helps you to very easily generate an Atom Feed for your website.


You can include this package through Composer using:

composer require roelofjan-elsinga/atom-feed-generator


use AtomFeedGenerator\AtomFeedGenerator;

/**@var \AtomFeedGenerator\FeedConfiguration $configuration*/

$generator = AtomFeedGenerator::withConfiguration($configuration);

// or

$generator = new AtomFeedGenerator($configuration);

/**@var \AtomFeedGenerator\FeedItem $feed_item*/


$atom_string = $generator->generate();

print $atom_string;

This will result in:

<?xml version="1.0" encoding="utf-8"?>

<feed xmlns="">
    <title>Feed title</title>
    <link href=""/>
        <name>Feed Author</name>
    <link rel="self" href=''/>
        <title>Article title</title>
        <link href=""/>
        <content>This is the content of the item</content>
        <summary>This is the summary</summary>
        <media:content xmlns:media="" url="/images/test-image.jpg" medium="image" type="image/jpeg" width="1920" height="1080" />


You can run the included tests by running ./vendor/bin/phpunit in your terminal.