Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
wapmorgan committed Aug 15, 2017
1 parent 8d726a1 commit f4f65e1
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions MorphosBladeProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class MorphosBladeProvider extends ServiceProvider {
public function boot() {
// @plural(count, noun)
Blade::directive('plural', function ($expression) {
return '<?php echo ('.$expression[1].').\' \'.morphos\\Russian\\pluralize('.$expression.'); ?>';
return '<?php echo ('.strstr($expression, ',', true).').\' \'.morphos\\Russian\\pluralize('.$expression.'); ?>';
});

// @numeral(number)
Expand All @@ -43,8 +43,7 @@ public function boot() {

// @money(value, currency)
Blade::directive('money', function ($expression) {
$expression = array_reverse(explode(',', $expression));
return '<?php echo \\morphos\\Russian\\MoneySpeller::spell('.implode(',', $expression).', \\morphos\\Russian\\MoneySpeller::SHORT_FORMAT) ?>';
return '<?php echo \\morphos\\Russian\\MoneySpeller::spell('.$expression.', \\morphos\\Russian\\MoneySpeller::SHORT_FORMAT) ?>';
});

// @name(name, case)
Expand Down

0 comments on commit f4f65e1

Please sign in to comment.