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


PHP Get::articleHeader方法代码示例

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


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

示例1: array

<?php

$bucket = array();
$url_base = $config->url . '/feed/json';
$json_order = strtoupper(Request::get('order', 'DESC'));
$json_filter = Request::get('filter', "");
$json_limit = Request::get('chunk', 25);
if ($pages = Mecha::eat(Get::articles($json_order, $json_filter))->chunk($config->offset, $json_limit)->vomit()) {
    foreach ($pages as $path) {
        $bucket[] = Get::articleHeader($path);
    }
}
$json = array('meta' => array('generator' => 'Mecha ' . MECHA_VERSION, 'title' => $config->title, 'slogan' => $config->slogan, 'url' => array('home' => $config->url, 'previous' => $config->offset > 1 ? Filter::colon('feed:url', $url_base . '/' . ($config->offset - 1)) : null, 'next' => $config->offset < ceil($config->total_articles / $json_limit) ? Filter::colon('feed:url', $url_base . '/' . ($config->offset + 1)) : null), 'description' => $config->description, 'update' => date('c'), 'author' => (array) $config->author, 'offset' => $config->offset, 'total' => $config->total_articles, 'tags' => Get::articleTags()), 'item' => null);
if (!empty($bucket)) {
    $json['item'] = array();
    foreach ($bucket as $i => $item) {
        $json['item'][$i] = array('title' => $item->title, 'url' => $item->url, 'date' => $item->date->W3C, 'update' => Date::format($item->update, 'c'), 'id' => $item->id, 'description' => $item->description, 'kind' => Mecha::A($item->kind));
        Weapon::fire('json_item', array(&$json['item'][$i], $item, $i));
    }
}
Weapon::fire('json_meta', array(&$json['meta']));
echo (isset($_GET['callback']) ? $_GET['callback'] . '(' : "") . json_encode($json) . (isset($_GET['callback']) ? ');' : "");
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:22,代码来源:json.php

示例2: function

<?php

/**
 * Article Manager
 * ---------------
 */
Route::accept(array($config->manager->slug . '/article', $config->manager->slug . '/article/(:num)'), function ($offset = 1) use($config, $speak) {
    $articles = false;
    $offset = (int) $offset;
    if ($files = Mecha::eat(Get::articles('DESC', "", 'txt,draft,archive'))->chunk($offset, $config->manager->per_page)->vomit()) {
        $articles = array();
        foreach ($files as $file) {
            $articles[] = Get::articleHeader($file);
        }
        unset($files);
    } else {
        if ($offset !== 1) {
            Shield::abort();
        }
    }
    Config::set(array('page_title' => $speak->articles . $config->title_separator . $config->manager->title, 'offset' => $offset, 'articles' => $articles, 'pagination' => Navigator::extract(Get::articles('DESC', "", 'txt,draft,archive'), $offset, $config->manager->per_page, $config->manager->slug . '/article'), 'cargo' => DECK . DS . 'workers' . DS . 'cargo.article.php'));
    Shield::lot('segment', 'article')->attach('manager', false);
});
/**
 * Article Composer/Updater
 * ------------------------
 */
Route::accept(array($config->manager->slug . '/article/ignite', $config->manager->slug . '/article/repair/id:(:num)'), function ($id = false) use($config, $speak) {
    Config::set('cargo', DECK . DS . 'workers' . DS . 'repair.article.php');
    if ($id && ($article = Get::article($id, array('content', 'excerpt', 'tags', 'comments')))) {
        $extension_o = $article->state === 'published' ? '.txt' : '.draft';
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.article.php


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