public function get() { $posts = Model::factory('Article')->where('status', '1')->order_by_desc('point')->limit(10)->find_many(); $feed = new FeedFactory(); $channel = new Channel(); $channel->title(config('site.title'))->description(config('site.default_meta'))->url(Url::site())->appendTo($feed); foreach ($posts as $post) { $item = new Item(); /** @var $post \Model\Article */ $item->title($post->title)->description(Html::fromMarkdown($post->content))->url($post->permalink())->pubDate(strtotime($post->created_at))->appendTo($channel); } $this->data = substr($feed, 0, -1); }
public function testSite() { $url = Url::site(); $this->assertEquals('http://apple.com/test', $url); }
/** * Get site url * * @return mixed */ function site_url() { return Url::site(); }