当前位置: 首页>>代码示例>>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;未经允许,请勿转载。