Download the PHP package trilobit-gmbh/contao-calculator-bundle without Composer

On this page you can find all versions of the php package trilobit-gmbh/contao-calculator-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package contao-calculator-bundle

Calculator Bundle

Das Calculator Bundle ermöglicht es durch Verwendung eines Insert-Tags eine Vielzahl an Operationen durchzuführen. Mögliche Operationen währen arithmetische Operationen, mit denen es möglich ist, einfache bis verschachtelte Berechnungen auszuführen. Durch die Verwendung der Symfony Expression Language ist es außerdem möglich, Variablen zu definieren und diese wiederum für Operationen zu verwenden. Diese Variablen können entweder in einer config.yml definiert werden dann muss diese mit dem Array parameters anfangen und unter www/app/config ihrer Webseite abgelegt werden. Oder sie fügen die Variablen in die parameters.yml ihrer Webseite ein, so wie im Beispiel unten.

Aufbau

Der Insert-Tag wird durch die Abkürzung "calc" definiert und mit zwei Doppelpunkten von der Operation getrennt. Dies könnte zum Beispiel so aussehen: {{calc::5 + 7}}, mit Variablen so: {{calc::Länge * Breite}} oder so {{calc::Rechteck['Länge'] * Rechteck['Breite']}}.

Mit Datum rechnen

Um mit Datum rechnen zu können müssen die Date-InsertTags mit [-Klammern geschrieben werden:

Die trilobit GmbH gibt es jetzt seit {{calc::[[date::Y]] - 1999}} Jahren.

Die trilobit GmbH ist jetzt {{calc::(([[date::Y]]*12+[[date::m]])-(1999*12+3)-(([[date::Y]]*12+[[date::m]])-(1999*12+3))%12)/12}} Jahre und {{calc::(([[date::Y]]*12+[[date::m]])-(1999*12+3))%12}} Monate alt.

Verwendung mit Formulardaten

Um mit Formulardaten rechnen zu können die müssen Post-InsertTags mit [-Klammern geschrieben werden:

Die trilobit GmbH bekommt jetzt {{post::spende}}€ und gibt davon {{calc::[[post::spende]] / 2}}€ an die Contao Association weiter.

Calculator bundle

The Calculator Bundle allows you to perform a variety of operations by using an insert-tag. Possible operations could be arithmetical operations with which it is possible to do simple to complex calculations. By using the Symfony Expression Language it is also possible to define variables and to use these for operations. These variables can either be defined in a config.yml but then they must start with the array parameters and be stored in www/app/config of your website. Or you add the variables to your parameters.yml of your website, as in the example below.

Structure

The insert tag is defined by the abbreviation "calc" and separated from the operation with two colons. For example, this could look like this: {{calc::5 + 7}}, with variables like this: {{calc::length * width}} or like this {{calc::rectangle['length'] * rectangle['width']}}.

How to use

Add parameters to your parameters.yml or config.yml:

Insert-Tag Ergebnis / Ausgabe
{{calc::5+7}} 12
{{calc::5+7*10}} 75
{{calc::trilobit}} 123
{{calc::trilobit*3}} 369
{{calc::contao['partner'][0]['type']}} Webdesign
{{calc::contao['partner'][0]['test']}} 42
{{calc::contao['partner'][0]['referenzen'][0]}} du
{{calc::contao['partner'][0]['test'] + trilobit}} 165
{{calc::github}} trilobit-gmbh

Installation

Install the extension via composer: trilobit-gmbh/contao-calculator-bundle.

Compatibility


All versions of contao-calculator-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^7.4 || ^8.0
contao/core-bundle Version ^4.13 || ^5.0
symfony/expression-language Version ^3.4 || ^4.0 || ^5.0 || ^6.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package trilobit-gmbh/contao-calculator-bundle contains the following files

Loading the files please wait ....