+1 vote
in Other by
i installed the plugin and cannot find anything that tells me how it works and how to use it. i have the icon in place and an empty onClick event

in homeSuccess.php:

<input class='submit_img' type="image" src="/images/rainbow/feed-icon-14x14.png" value="Feed" alt="Feed" onClick="gotoFeed(this.value,<?php echo $usr_profile->getId();?>)">

gotoFeed JS in homeSuccess.php:

function gotoFeed(id)

{

   console.log("testing");      

   //must redirect to  feeds page??

}

in the actions class:

public function executeFeed(sfWebRequest $request)

{

    $profile_id = $this->getUser()->getAttribute('profile_id','zero');      

}

can anybody help please? thanks

JavaScript questions and answers, JavaScript questions pdf, JavaScript question bank, JavaScript questions and answers pdf, mcq on JavaScript pdf, JavaScript questions and solutions, JavaScript mcq Test , Interview JavaScript questions, JavaScript Questions for Interview, JavaScript MCQ (Multiple Choice Questions)

1 Answer

0 votes
by
You can find the complete tutorial at this link sfFeed2Plugin, just clicking the tab Readme

UPDATE

I'm using this plugin with an action like this in my action class:

  public function executeFeedRss(sfWebRequest $request)

  {

    $feed = new sfRss201Feed();

    $feed->setTitle('MySite');

    $feed->setLink($this->generateUrl('@homepage'));

    $c = new Criteria;

    $c->addDescendingOrderByColumn(PostPeer::CREATED_AT);

    $c->setLimit(10);

    $Posts = PostPeer::doSelect($c);

    foreach ($Posts as $post)

    {

      $item = new sfFeedItem();

      $item->setTitle($post->getTitle());

      // according to routing rule

      $item->setLink($this->generateUrl('@posts', array('id'=>$post->getId())));

      $item->setPubdate($post->getCreatedAt('U'));

      $item->setUniqueId($post->getSlug());

      $item->setDescription($post->getBody());

      $feed->addItem($item);

    }    

    $this->feed = $feed;

  }

and this code inside the template feedRssSuccess.php:

<?php decorate_with(false) ?>

<?php echo $feed->asXml(ESC_RAW) ?>

Finally simply I have a link to this action in my layout through a template, but of course in a pageSuccess.php is the same.

I hope this can help you.

Related questions

+1 vote
asked Feb 1, 2022 in Other by DavidAnderson
+1 vote
asked Feb 1, 2022 in Other by DavidAnderson
...