Ejemplo n.º 1
0
 public function showView()
 {
     if (!($feed = $this->getFeed())) {
         return View::handleError('Unable to located feed.');
     }
     $title = $feed->name;
     $feeds = $this->getFeeds();
     try {
         $feeder = new Feeder($feed->url);
         $feeder->fetchFeed();
     } catch (\Exception $e) {
         return View::handleError($e->getMessage(), 500);
     }
     return View::make('feed.view')->with(compact('title', 'feeds', 'feed', 'feeder'))->render();
 }
Ejemplo n.º 2
0
 /**
  * XML validation.
  * 
  * @param  string $field
  * @param  mixed  $value
  * @return void
  */
 protected function validateXml($field, $value)
 {
     try {
         $feeder = new Feeder($value);
         $feeder->fetchFeed();
         // Slow, but..
     } catch (\Exception $e) {
         $this->addError($field, 'xml');
     }
 }