當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Registry::prop方法代碼示例

本文整理匯總了PHP中Registry::prop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Registry::prop方法的具體用法?PHP Registry::prop怎麽用?PHP Registry::prop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Registry的用法示例。


在下文中一共展示了Registry::prop方法的12個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: article_category_id

function article_category_id()
{
    if ($category = Registry::prop('article', 'category')) {
        $categories = Registry::get('all_categories');
        return $categories[$category]->id;
    }
}
開發者ID:boryszielonka,項目名稱:anchor-post-loop,代碼行數:7,代碼來源:post-loop.php

示例2: page_custom_field

function page_custom_field($key, $default = '')
{
    $id = Registry::prop('page', 'id');
    if ($extend = Extend::field('page', $key, $id)) {
        return Extend::value($extend, $default);
    }
    return $default;
}
開發者ID:k4kfh,項目名稱:anchor-cms,代碼行數:8,代碼來源:pages.php

示例3: my_get_description

function my_get_description($len = 500)
{
    if (!Registry::get('article')) {
        $description = site_description();
    } else {
        $description = trim(Registry::prop('article', 'description'));
        if (empty($description)) {
            $description = parse(Registry::prop('article', 'html'));
        }
        $description = trim(preg_replace('#<[^>]+>#', ' ', $description));
    }
    if (strlen($description) > $len) {
        $description = substr($description, 0, $len - 3) . '...';
    }
    return preg_replace('/[\\n\\r\\t]+/', ' ', preg_replace('/\\s+/', ' ', $description));
}
開發者ID:aravindanve,項目名稱:anchor-maeby-light,代碼行數:16,代碼來源:functions.php

示例4: active

 public function active()
 {
     if (Registry::prop('page', 'slug') == $this->slug || Registry::prop('page', 'parent') == $this->id) {
         return true;
     }
 }
開發者ID:gautamkrishnar,項目名稱:Anchor-CMS-openshift-quickstart,代碼行數:6,代碼來源:page.php

示例5: article_adjacent_url

/**
* Get the url to an adjacent article
* @param string		prev || previous || next
* @return string
*/
function article_adjacent_url($side = 'next')
{
    $comparison = '>';
    $order = 'asc';
    if (strtolower($side) == 'prev' || strtolower($side) == 'previous') {
        $comparison = '<';
        $order = 'desc';
    }
    $page = Registry::get('posts_page');
    $query = Post::where('created', $comparison, Registry::prop('article', 'created'))->where('status', '!=', 'draft');
    if ($query->count()) {
        $article = $query->sort('created', $order)->fetch();
        $page = Registry::get('posts_page');
        return base_url($page->slug . '/' . $article->slug);
    }
}
開發者ID:heianxing,項目名稱:anchor-cms,代碼行數:21,代碼來源:articles.php

示例6: comments_open

function comments_open()
{
    return Registry::prop('article', 'comments') ? true : false;
}
開發者ID:silviuu,項目名稱:blg,代碼行數:4,代碼來源:comments.php

示例7: is_postspage

function is_postspage()
{
    return Registry::prop('page', 'id') == Config::meta('posts_page');
}
開發者ID:biggtfish,項目名稱:anchor-cms,代碼行數:4,代碼來源:helpers.php

示例8: menu_parent

function menu_parent()
{
    return Registry::prop('menu_item', 'parent');
}
開發者ID:biggtfish,項目名稱:anchor-cms,代碼行數:4,代碼來源:menus.php

示例9: search_item_slug

function search_item_slug()
{
    return Registry::prop('search_item', 'slug');
}
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:4,代碼來源:search.php

示例10: article_author_bio

function article_author_bio()
{
    return Registry::prop('article', 'author_bio');
}
開發者ID:ericluwj,項目名稱:lco,代碼行數:4,代碼來源:articles.php

示例11: category_description

function category_description()
{
    return Registry::prop('category', 'description');
}
開發者ID:gautamkrishnar,項目名稱:Anchor-CMS-openshift-quickstart,代碼行數:4,代碼來源:categories.php

示例12: menu_parent

function menu_parent($menu_item = null)
{
    if (is_array($menu_item)) {
        return $menu_item['parent'];
    }
    return $menu_item ? $menu_item->parent : Registry::prop('menu_item', 'parent');
}
開發者ID:anchorcms,項目名稱:anchor-cms,代碼行數:7,代碼來源:menus.php


注:本文中的Registry::prop方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。