get($args);
if (!is_numeric($numberOfStars)) {
return "The value you passed to this helper is not a number.";
}
$output = "";
for ($i=1; $i <= 5; $i++) {
if ($i <= $numberOfStars) {
$output .= "";
} else {
$output .= "";
}
}
return $output;
};
}
public static function numberFormatter()
{
return function ($template, $context, $args, $source) {
$totalCount = $context->get($args);
if (!is_numeric($totalCount)) {
return "The value you passed to this helper is not a number.";
}
return number_format($totalCount);
};
}
public static function currencyFormatter()
{
return function ($template, $context, $args, $source) {
$totalCount = $context->get($args);
if ($totalCount === "Free") {
return "Free";
}
if (!is_numeric($totalCount)) {
return "The value you passed to this helper is not a number.";
}
return "$" . number_format($totalCount, 2);
};
}
}