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


PHP Config::meta方法代码示例

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


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

示例1: __construct

 public function __construct($template, $vars = array())
 {
     // base path
     $base = PATH . 'themes' . DS . Config::meta('theme') . DS;
     // custom article and page templates
     if ($template == 'page' or $template == 'article') {
         if ($item = Registry::get($template)) {
             if (is_readable($base . $template . '-' . $item->slug . EXT)) {
                 $template .= '-' . $item->slug;
             } elseif (is_readable($base . $template . 's/' . $template . '-' . $item->slug . EXT)) {
                 $template .= 's/' . $template . '-' . $item->slug;
             } elseif (is_readable($base . $item->pagetype . EXT)) {
                 $template = $item->pagetype;
                 if (is_readable($base . $item->pagetype . '-' . $item->slug . EXT)) {
                     $template .= '-' . $item->slug;
                 }
             }
         }
     }
     if ($template == 'posts') {
         if ($item = Registry::get('post_category')) {
             if (is_readable($base . 'category-' . $item->slug . EXT)) {
                 $template = 'category';
                 $template .= '-' . $item->slug;
             }
         }
     }
     $this->path = $base . $template . EXT;
     $this->vars = array_merge($this->vars, $vars);
 }
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:30,代码来源:template.php

示例2: format

 public static function format($date, $format = null)
 {
     // set the meta format
     if (is_null($format)) {
         $format = Config::meta('date_format', 'jS F, Y');
     }
     $date = new DateTime($date, new DateTimeZone('GMT'));
     $date->setTimezone(new DateTimeZone(Config::app('timezone')));
     return $date->format($format);
 }
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:10,代码来源:date.php

示例3: page_description

function page_description($default = '')
{
    if ($title = Registry::prop('article', 'description')) {
        return $title;
    }
    if ($title = Config::meta('description')) {
        return $title;
    }
    return $default;
}
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:10,代码来源:pages.php

示例4: version

 public static function version()
 {
     // first time
     if (!($last = Config::meta('last_update_check'))) {
         $last = static::setup();
     }
     // was update in the last 30 days
     if (strtotime($last) < time() - 60 * 60 * 24 * 30) {
         static::renew();
     }
 }
开发者ID:biggtfish,项目名称:anchor-cms,代码行数:11,代码来源:update.php

示例5: migrations

 public static function migrations()
 {
     $current = Config::meta('current_migration');
     $migrate_to = Config::migrations('current');
     $migrations = new Migrations($current);
     $table = Base::table('meta');
     if (is_null($current)) {
         $number = $migrations->up($migrate_to);
         Query::table($table)->insert(array('key' => 'current_migration', 'value' => $number));
     } else {
         if ($current < $migrate_to) {
             $number = $migrations->up($migrate_to);
             Query::table($table)->where('key', '=', 'current_migration')->update(array('value' => $number));
         }
     }
 }
开发者ID:ericluwj,项目名称:lco,代码行数:16,代码来源:application.php

示例6: search_next

function search_next($text = 'Next', $default = '')
{
    $per_page = Config::meta('posts_per_page');
    $page = Registry::get('page_offset');
    $offset = ($page - 1) * $per_page;
    $total = Registry::get('total_posts');
    $pages = floor($total / $per_page);
    $search_page = Registry::get('page');
    $next = $page + 1;
    $term = Registry::get('search_term');
    Session::put(slug($term), $term);
    $url = base_url($search_page->slug . '/' . $term . '/' . $next);
    if ($page - 1 < $pages) {
        return '<a href="' . $url . '">' . $text . '</a>';
    }
    return $default;
}
开发者ID:gautamkrishnar,项目名称:Anchor-CMS-openshift-quickstart,代码行数:17,代码来源:search.php

示例7: search_prev

function search_prev($text = 'Previous', $default = '')
{
    $per_page = Config::meta('posts_per_page');
    $page = Registry::get('page_offset');
    $offset = ($page - 1) * $per_page;
    $total = Registry::get('total_posts');
    $pages = ceil($total / $per_page);
    $search_page = Registry::get('page');
    $prev = $page - 1;
    $term = Registry::get('search_term');
    Session::put(slug($term), $term);
    $url = base_url($search_page->slug . '/' . $term . '/' . $prev);
    if ($offset > 0) {
        return '<a href="' . $url . '">' . $text . '</a>';
    }
    return $default;
}
开发者ID:k4kfh,项目名称:anchor-cms,代码行数:17,代码来源:search.php

示例8: parse

function parse($str, $markdown = true)
{
    // process tags
    $pattern = '/[\\{\\{]{1}([a-z]+)[\\}\\}]{1}/i';
    if (preg_match_all($pattern, $str, $matches)) {
        list($search, $replace) = $matches;
        foreach ($replace as $index => $key) {
            $replace[$index] = Config::meta($key);
        }
        $str = str_replace($search, $replace, $str);
    }
    $str = html_entity_decode($str, ENT_NOQUOTES, System\Config::app('encoding'));
    //  Parse Markdown as well?
    if ($markdown === true) {
        $md = new Parsedown();
        $str = $md->text($str);
    }
    return $str;
}
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:19,代码来源:helpers.php

示例9: perPage

 public static function perPage()
 {
     return Config::meta('show_all_posts') ? self::count() + 1 : Config::meta('posts_per_page');
 }
开发者ID:biggtfish,项目名称:anchor-cms,代码行数:4,代码来源:post.php

示例10: posts_per_page

function posts_per_page()
{
    return min(Registry::get('total_posts'), Config::meta('posts_per_page'));
}
开发者ID:gautamkrishnar,项目名称:Anchor-CMS-openshift-quickstart,代码行数:4,代码来源:posts.php

示例11: foreach

        </hgroup>
        <hgroup class="wrap"><h1>Français</h1></hgroup>
        <ul class="main list">
            <?php 
$introParts = ['custom_address1', 'custom_address2', 'custom_mail', 'custom_telnumber'];
foreach ($introParts as $part) {
    echo "<li>" . "<a href='" . Uri::to('admin/accueil/editInfo/' . $part) . "'>" . "<strong>" . strip_tags(Config::meta($part)) . "</strong>" . "</a>" . "</li>";
}
?>
        </ul>
        <hgroup class="wrap"><h1>Anglais</h1></hgroup>
        <ul class="main list">
            <?php 
$introParts = ['custom_address1_en', 'custom_address2_en', 'custom_mail_en', 'custom_telnumber_en'];
foreach ($introParts as $part) {
    echo "<li>" . "<a href='" . Uri::to('admin/accueil/editInfo/' . $part) . "'>" . "<strong>" . strip_tags(Config::meta($part)) . "</strong>" . "</a>" . "</li>";
}
?>
        </ul>
    </section>

    <section class="wrap">
        <hgroup class="wrap">
            <h1>Votre biographie</h1>
            <nav>
                <!--            --><?php 
//echo Html::link('admin/accueil/addBio', __('accueil.create_bio'), array('class' => 'btn'));
?>
            </nav>
        </hgroup>
        <hgroup class="wrap"><h1>Français</h1></hgroup>
开发者ID:Rictus,项目名称:CMS_Prod,代码行数:31,代码来源:index.php

示例12: posts

 public static function posts()
 {
     return static::find(Config::meta('posts_page'));
 }
开发者ID:gautamkrishnar,项目名称:Anchor-CMS-openshift-quickstart,代码行数:4,代码来源:page.php

示例13: site_meta

function site_meta($key, $default = '')
{
    return Config::meta('custom_' . $key, $default);
}
开发者ID:anchorcms,项目名称:anchor-cms,代码行数:4,代码来源:metadata.php

示例14: is_postspage

function is_postspage()
{
    return Registry::prop('page', 'id') == Config::meta('posts_page');
}
开发者ID:biggtfish,项目名称:anchor-cms,代码行数:4,代码来源:helpers.php

示例15: my_full_theme_url

function my_full_theme_url($file = '')
{
    $theme_folder = Config::meta('theme');
    $base = 'themes' . '/' . $theme_folder . '/';
    return full_url($base . ltrim($file, '/'));
}
开发者ID:aravindanve,项目名称:anchor-maeby-light,代码行数:6,代码来源:functions.php


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