當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。