sfFeedHelperPlugin

プラグインの仕組みとsfMixerクラスを試したくて、RSS Auto-discoveryヘルパープラグインを作ってみた。

install

symfony plugin-install http://www.asahi-net.or.jp/~kr2a-akt/sfFeedHelperPlugin-0.1.0.tgz

layout.php

<head>

<?php echo include_http_metas() ?>
<?php echo include_metas() ?>

<?php echo include_title() ?>

<?php echo include_feeds() ?>

actions.class.php

public function executeIndex()
{
    $this->getResponse()->addFeed('@feed_recent');
    $this->getResponse()->addFeed('@feed_hot');
}

public function executeTag()
{
    $this->getResponse()->addFeed('@feed_tag?name=' . $this->getRequestParameter('name'));
}

settings.yml

all:
  .settings:
    standard_helpers:       [Partial, Cache, Form, Feed]


元ネタ:http://spindrop.us/2006/07/04/dynamic-linking-to-syndication-feeds-with-symfony/