web-technologies/yii2-calculator
Composer 安装命令:
composer require web-technologies/yii2-calculator
包简介
Calculator extension for yii2
关键字:
README 文档
README
Calculator extension for yii2
Installation
The preferred way to install this extension is through composer.
Either run
php composer.phar require web-technologies/yii2-calculator "*"
or add
"web-technologies/yii2-calculator": "*"
to the require section of your composer.json file.
Configuration
In config file
/config/web.php
Add math component
'components' => array(
...
'math' => array(
'class' => 'webtechnologies\calculator\Math',
//'handlerClass' => 'namespace/to/customHandlerClass', //optional parameter
),
)
Usage
Once the extension is installed, simply use it in your code by :
<?=Yii::$app->math->expr('( 5 + (5 * 6) - 3 + 4 * 4 ^ 6 + ( -3 * -5 * 4 + ( 3 / 34 + 1 * 3 + 6 - 3 + ( 4 / 2 ) ) ) ) * -1')?> //output: -16484.088235294
统计信息
- 总下载量: 17
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 1
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-02