Download the PHP package regulus/tetra-text without Composer

On this page you can find all versions of the php package regulus/tetra-text. 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 tetra-text

TetraText

A small text/string formatting composer package for Laravel 5 that formats numeric values, money values, phone numbers, and more. There are also some limited date functions available.

Installation

To install TetraText, make sure "regulus/tetra-text" has been added to Laravel 5's composer.json file.

"require": {
    "regulus/tetra-text": "0.6.*"
},

Then run php composer.phar update from the command line. Composer will install the TetraText package. Now, all you have to do is register the service provider and set up TetraText's alias in config/app.php. Add this to the providers array:

Regulus\TetraText\TetraTextServiceProvider::class,

And add this to the aliases array:

'Format' => Regulus\TetraText\Facade::class,

You may use 'TetraText', or another alias, but 'Format' is recommended for the sake of simplicity. TetraText is now ready to go.

Available Functions

Format a string as a number:

Format a string into a dollar value:

The advantage of the money() function over PHP's number_format() is that negative dollar values will come out as -$343.00 instead of $-343.00 like they would if you simply concatenated a dollar sign to a string formatted with number_format().

Turn a value into a percent of a specified total (and avoid "division by zero" error):

Format a North American phone number:

You may pass the phone() function a string or an integer. It will automatically strip out non-numeric characters before formatting the variable into a phone number.

Format a Canadian postal code:

Format a boolean as a string:

Add a suffix to a number:

Pluralize an item name based on a specified number:

Pluralize a string based on a specified number:

Get the correct English word prefix for an item name ("a" or "an", based on the sound of the starting syllable):

Convert a string to HTML characters:

Convert a string to a URI slug:

Convert a string to a unique URI slug based on the specified table and field name:

Get the first day of a week:

Get the last day of a week:

Get the first day of a month:

Get the last day of a month:

Convert new lines to paragraphs:

Apply a character limit to a string:

Note: charLimit() and wordLimit() were designed to maintain HTML tag integrity.

Apply a character limit to a string:

Note: transA() and transChoiceA() can also make use your resulting string lowercase by setting the second or third argument to true. The second argument (second for transA(), third for transChoiceA()) is the parameters array, but if it is a boolean, the parameters array will be set to empty and it will be interpreted as the lower argument instead.


All versions of tetra-text with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
laravel/framework Version >=5.0.0
ezyang/htmlpurifier Version >=4.8.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 regulus/tetra-text contains the following files

Loading the files please wait ....