本文整理汇总了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);
}
}
示例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();
}
}
示例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.
示例4: langNum
static function langNum($strings, $number)
{
return Str::langNum($strings, $number, true);
}