Math Plus
This plugin provides support for doing simple mathematical operations in templates.
There is already the plugin Simple Math which has the same purpose.
Math Plus plugin differs from Simple Math only in one feature: it is required to use a tag pair instead of single tag. Tag pair allows for better control of the parse order.
PARAMETERS
1) calculate - Required. Alows you to input a string consisting of numbers,
symbols of mathematical operations and round brackets, e.g
calculate = “(10 + 5) / 3”. Examples of symbols of supported mathematical operations are:
+ (addition), - (subtraction), * (multiplication), / (division),
% (division remainder), ++ (increment),—(decrement).
2) invalid_input - Optional. Accepts two values: “alert” and “silence”.
Default value is “silence”. If the value is “alert”, then in cases when
the plugin has some problem with parameters, PHP alert is being shown;
if the value is “silence”, then in cases when the plugin has
some problem with parameters, it finishes its work without any alert being shown.
Set this parameter to “alert” for development, and to “silence” - for deployment.
USAGE
Use this plugin as folllows:
{exp:math_plus calculate=”(10 + 5) / 3”}
{math_plus_result}
{/exp:math_plus}
Скачать
Версия EE | Файл | Изменения |
---|---|---|
Скачать |
Ссылки
http://expressionengine.com/archived_forums/viewthread/150136/Комментарии
Ещё никто не оставлял комментариев, Вы будете первым.