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


PHP Str::langNum方法代碼示例

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


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

示例1: menu_cart

 static function menu_cart(MenuItem $item)
 {
     $item->url = route('vanemart::cart');
     $item->classes[] = 'cart';
     $key = Cart::has() ? 'cart_filled' : 'cart';
     $item->caption = \Vane\Menu::caption($key);
     if (Cart::has()) {
         $sum = Cart::subtotal();
         $replaces = array('sumn' => Str::number($sum), 'summ' => Str::langNum('general.price', $sum), 'sumf' => Str::langNum('general.currency_full', $sum), 'sums' => Str::langNum('general.currency_short', $sum), 'count' => Str::langNum('general.goods', Cart::count()));
         $item->caption = Str::format($item->caption, $replaces);
         $item->hint = Str::format(\Vane\Menu::caption('cart_hint'), $replaces);
     }
 }
開發者ID:SerdarSanri,項目名稱:VaneMart,代碼行數:13,代碼來源:MenuHandlers.php

示例2: summary

 static function summary($html = false)
 {
     $items = Str::langNum('general.goods', static::count(), $html);
     $sum = Str::langNum('general.price', static::subtotal(), $html);
     if ($html) {
         return HLEx::lang('cart.summary', compact('items', 'sum'), false);
     } else {
         return __('vanemart::cart.summary', compact('items', 'sum'))->get();
     }
 }
開發者ID:SerdarSanri,項目名稱:VaneMart,代碼行數:10,代碼來源:Cart.php

示例3: function

        }
    }
});
/*-----------------------------------------------------------------------
| POST BLOCK
|----------------------------------------------------------------------*/
// Fired to return a default (automatic) post text when submitting a form without one.
// If doesn't return a non-empty string post form is returned with "Empty body" error.
//
//* $options hash - 'block' Block_Post, 'type' str, 'object' int/mixed.
//
//= str body message to post
Event::listen(VANE_NS . 'post.bodyless', function (array $options) {
    $block = $options['block'];
    if ($block->userCanAttach() and $names = $block->uploadedFileNames()) {
        return __(Current::expand('post.add.bodyless_fmsg'), array('text' => Str::langNum('post.add.bodyless_ftext', count($names)), 'files' => join(', ', $names)))->get();
    }
});
// Fired when a new (prepared) Post model needs to be inserted into the database.
//
//= bool
Event::listen(VANE_NS . 'post.insert', function (Post &$post) {
    return $post->save();
});
// Fired once a new Post has been successfully placed.
Event::listen(VANE_NS . 'post.inserted', function (Post $post) {
});
// Fired at the point when attachments, if any, should be added to the created Post.
// Any produced exception will cause the Post to be deleted to maintain integrity.
//
//* $options hash - the same as in post.bodyless plus 'post' Post.
開發者ID:SerdarSanri,項目名稱:VaneMart,代碼行數:31,代碼來源:events.php

示例4: langNum

 static function langNum($strings, $number)
 {
     return Str::langNum($strings, $number, true);
 }
開發者ID:SerdarSanri,項目名稱:VaneMart,代碼行數:4,代碼來源:HLEx.php


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