예제 #1
0
파일: Feed.php 프로젝트: MenZil-Team/inews
 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);
 }
예제 #2
0
파일: UrlTest.php 프로젝트: pagon/framework
 public function testSite()
 {
     $url = Url::site();
     $this->assertEquals('http://apple.com/test', $url);
 }
예제 #3
0
/**
 * Get site url
 *
 * @return mixed
 */
function site_url()
{
    return Url::site();
}