当前位置: 首页>>代码示例>>PHP>>正文


PHP Feed::factory方法代码示例

本文整理汇总了PHP中Feed::factory方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::factory方法的具体用法?PHP Feed::factory怎么用?PHP Feed::factory使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Feed的用法示例。


在下文中一共展示了Feed::factory方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: action_feed

 /**
  * Action to get only single feed html
  * @param int feed_id
  * will be used in ajax requests to get the recently added field
  */
 public function action_feed()
 {
     $feed_id = $this->request->param('feed_id');
     $feed = ORM::factory('feed', $feed_id);
     $feeds = array();
     $feeds[$feed->id] = Feed::factory($feed->type, $feed->id)->render();
     $view = View::factory('feed/feeds')->bind('feeds', $feeds);
     $this->content = $view;
 }
开发者ID:hemsinfotech,项目名称:kodelearn,代码行数:14,代码来源:feed.php

示例2: countFeeds

 protected function countFeeds()
 {
     return Feed::factory()->count();
 }
开发者ID:inscriptionweb,项目名称:shaarli-api,代码行数:4,代码来源:cron.php

示例3: discussion

 /**
  * Search linked entries
  * @route /discussion
  * @args url={url}
  */
 public function discussion($arguments)
 {
     if (isset($arguments['url']) && !empty($arguments['url'])) {
         $search_method = 'strict';
         $url = trim($arguments['url']);
         $entries = Feed::factory()->select_expr('feeds.id AS feed_id, feeds.url AS feed_url, feeds.link AS feed_link, feeds.title AS feed_title')->select_expr('entries.id, date, permalink, entries.title, content, categories')->join('entries', array('entries.feed_id', '=', 'feeds.id'))->order_by_desc('date');
         if ($search_method == 'strict') {
             $entries->where('entries.permalink', $url);
         } else {
             if ($search_method == 'large') {
                 // TODO: à réfléchir...
                 $url = trim($url, '/') . '%';
                 $entries->where_like('entries.permalink', $url);
             }
         }
         $entries = $entries->findArray();
         if ($entries != null) {
             foreach ($entries as &$entry) {
                 $entry['feed']['id'] = $entry['feed_id'];
                 $entry['feed']['url'] = $entry['feed_url'];
                 $entry['feed']['link'] = $entry['feed_link'];
                 $entry['feed']['title'] = $entry['feed_title'];
                 unset($entry['feed_id'], $entry['feed_url'], $entry['feed_link'], $entry['feed_title']);
             }
         }
         return $entries;
     } else {
         throw new ShaarliApiException('Need url (?url=url)');
     }
 }
开发者ID:inscriptionweb,项目名称:shaarli-api,代码行数:35,代码来源:ShaarliApi.php


注:本文中的Feed::factory方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。