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


PHP Get::pages方法代码示例

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


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

示例1: function

/**
 * Configuration Manager
 * ---------------------
 */
Route::accept($config->manager->slug . '/config', function () use($config, $speak) {
    if (!Guardian::happy(1)) {
        Shield::abort();
    }
    Config::set(array('page_title' => $speak->configs . $config->title_separator . $config->manager->title, 'cargo' => 'cargo.config.php'));
    if ($request = Request::post()) {
        Guardian::checkToken($request['token']);
        $bools = array('comments.allow' => false, 'comments.moderation' => false, 'widget_include_css' => false, 'widget_include_js' => false, 'html_parser.active' => Request::post('html_parser.active', false));
        $pages = array('index' => 'article', 'tag' => 'tag', 'archive' => 'archive', 'search' => 'search', 'manager' => 'manager');
        $slugs = array();
        if ($files = Get::pages()) {
            foreach ($files as $file) {
                list($_time, $_kind, $_slug) = explode('_', File::N($file), 3);
                $slugs[$_slug] = 1;
            }
            unset($files);
        }
        foreach ($bools as $bool => $fallback) {
            // Fix(es) for checkbox input(s)
            Mecha::SVR($request, $bool, Request::post($bool, $fallback));
        }
        foreach ($pages as $page => $default) {
            // Fix(es) for slug pattern input(s)
            $request[$page]['slug'] = Text::parse(Request::post($page . '.slug', $default), '->slug');
            if (Request::post($page . '.per_page') < 1 || floor(Request::post($page . '.per_page')) != Request::post($page . '.per_page')) {
                Notify::error($speak->notify_invalid_per_page_number);
开发者ID:yiannisSt,项目名称:mecha-cms,代码行数:30,代码来源:route.config.php

示例2: array

<?php

$bucket = array();
if ($config->total_pages > 0) {
    foreach (Get::pages() as $page) {
        list($time, $kind, $slug) = explode('_', File::N($page), 3);
        $bucket[] = (object) array('url' => $config->url . '/' . $slug, 'date' => Date::format($time, 'c'), 'changefreq' => 'weekly', 'priority' => (string) '0.5');
    }
}
if ($config->total_articles > 0) {
    foreach (Get::articles() as $article) {
        list($time, $kind, $slug) = explode('_', File::N($article), 3);
        $bucket[] = (object) array('url' => $config->url . '/' . $config->index->slug . '/' . $slug, 'date' => Date::format($time, 'c'), 'changefreq' => 'weekly', 'priority' => (string) '1.0');
    }
}
echo '<?xml version="1.0" encoding="UTF-8" ?>';
echo '<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">';
if (!empty($bucket)) {
    foreach ($bucket as $i => $item) {
        echo '<url>';
        echo '<loc>' . $item->url . '</loc>';
        echo '<lastmod>' . $item->date . '</lastmod>';
        echo '<changefreq>' . $item->changefreq . '</changefreq>';
        echo '<priority>' . $item->priority . '</priority>';
        Weapon::fire('sitemap_item', array($item, $i));
        echo '</url>';
    }
}
echo '</urlset>';
开发者ID:razordaze,项目名称:mecha-cms,代码行数:29,代码来源:sitemap.php

示例3: array

     }
     $page = Mecha::O(array('id' => "", 'path' => "", 'state' => 'draft', 'date' => array('W3C' => ""), 'title' => $config->defaults->page_title, 'slug' => "", 'content_raw' => $config->defaults->page_content, 'content_type' => $config->html_parser, 'description' => "", 'author' => Guardian::get('author'), 'css_raw' => $config->defaults->page_custom_css, 'js_raw' => $config->defaults->page_custom_js, 'fields' => array()));
     Config::set(array('page_title' => Config::speak('manager.title_new_', $speak->page) . $config->title_separator . $config->manager->title, 'page' => Mecha::A($page)));
 }
 $G = array('data' => Mecha::A($page));
 Config::set('html_parser', $page->content_type);
 if ($request = Request::post()) {
     Guardian::checkToken($request['token']);
     $task_connect = $page;
     include DECK . DS . 'workers' . DS . 'task.field.5.php';
     include DECK . DS . 'workers' . DS . 'task.field.6.php';
     $extension = $request['action'] === 'publish' ? '.txt' : '.draft';
     // Check for duplicate slug, except for the current old slug.
     // Allow user(s) to change their post slug, but make sure they
     // do not type the slug of another post.
     if (trim($slug) !== "" && $slug !== $page->slug && ($files = Get::pages('DESC', "", 'txt,draft,archive'))) {
         foreach ($files as $file) {
             if (strpos(File::B($file), '_' . $slug . '.') !== false) {
                 Notify::error(Config::speak('notify_error_slug_exist', $slug));
                 Guardian::memorize($request);
                 break;
             }
         }
         unset($files);
     }
     // Slug must contains at least one letter or one `-`
     if (!preg_match('#[a-z\\-]#i', $slug)) {
         Notify::error($speak->notify_error_slug_missing_letter);
         Guardian::memorize($request);
     }
     // Check for empty post content
开发者ID:razordaze,项目名称:mecha-cms,代码行数:31,代码来源:route.page.php


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