PHP code example of marcw / rss-writer

1. Go to this page and download the library: Download marcw/rss-writer library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

marcw / rss-writer example snippets


use MarcW\RssWriter\Bridge\Symfony\HttpFoundation\RssStreamedResponse;

public function myAction()
{
    // $channel = ... (whatever you use to create your Channel object)

    return new RssStreamedResponse($channel, $this->get('marcw_rss_writer.rss_writer'));
}



namespace AppBundle\Form;

use MarcW\RssWriter\Bridge\Symfony\Form\ChoiceList\Loader\ItunesCategoryChoiceLoader;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\ChoiceType;
use Symfony\Component\Form\FormBuilderInterface;

class MyFormType extends AbstractType
{
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        // ...
        $builder->add('category', ChoiceType::class, ['choice_loader' => new ItunesCategoryChoiceLoader()])
        // ...
    }
}

new MarcW\RssWriter\Bundle\MarcWRssWriterBundle()