Download the PHP package carbon/eel without Composer

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

Latest stable version Total downloads

Carbon.Eel Package for Neos CMS

BEM Helper

Generates BEM classes. The modifiers property can be a string (for one modifier), an array (e.g. ['one', 'two']), or an array with keys and values. If you have an array with keys and values (like a Fusion DataStructure) and a value is true, the key's name gets used for the modifier.

BEM.array(block, element, modifiers)

Shortcut to Carbon.Array.BEM(block, element, modifiers)

BEM.string(block, element, modifiers)

Shortcut to Carbon.String.BEM(block, element, modifiers)

BEM.modifier(class, modifiers)

Generates a string with BEM classes. The modifiers property can be a string (for one modifier), an array (e.g. ['one', 'two']), or an array with keys and values. If you have an array with keys and values (like a Fusion DataStructure) and the value is true, the key's name gets used for the modifier.

Return The string

Array Helper

Carbon.Array.BEM(block, element, modifiers)

Generates an array with BEM classes. The modifiers property can be a string (for one modifier), an array (e.g. ['one', 'two']), or an array with keys and values. If you have an array with keys and values (like a Fusion DataStructure) and the value is true, the key's name gets used for the modifier.

Return The array

Carbon.Array.chunck(array, length, preserveKeys)

Chunks an array into arrays with length elements. The last chunk may contain less than length elements.

Carbon.Array.join(array, separator)

Join the given array recursively using the given separator.

Return The converted array as a string

Carbon.Array.extractSubElements(array, preserveKeys)

This method extracts sub-elements to the parent level.

An input array of type:

will be converted to:

Return The converted array

Carbon.Array.intersect(array1, array2, array_)

Returns an array containing all the values of array1 that are present in all the arguments.

Carbon.Array.length(array)

The method counts elements of a given array or a countable object. Return 0 if it is not an countable object.

Carbon.Array.hasKey(array, key)

Returns a boolean if the array has a specific key

Carbon.Array.hasValue(array, value)

Returns a boolean if the array has a specific value

Carbon.Array.getValueByPath(array, path)

Returns the value of a nested array by following the specified path.

Carbon.Array.setValueByPath(array, path, value)

Sets the given value in a nested array or object by following the specified path.

Carbon.Array.check(variable)

Check if a variable is iterable and has items

Return The variable or null if it is empty or not an iterable

Carbon.Array.isCountable(variable)

Check if the given variable is countable

Return true or false

Carbon.Array.sortByItem(array, key, direction)

Return The sorted array

Date Helper

Carbon.Date.secondsUntil(string)

Return seconds until the given offset. . Very useful for maximumLifetime on the @cache entry.

In this example, we clear the cache at midnight by adding an offset of 0 hours.

To get the seconds until next year, you can do it like this:

Return The timespan in seconds (integer)

Carbon.Date.timeToDateInterval(string)

Convert time duration (1:00) into a DateInterval

Return The duration as DateInterval

FileContent Helper

Carbon.FileContent.path(string)

Returns the file content of a path. Fails silently.

Examples:

Return The content of the file

Carbon.FileContent.pathHash(string, length)

Returns the hash value from the file content of a path. Fails silently.

Examples:

Return The hash value from the content of the file

Carbon.FileContent.resource(resource)

Returns the file content of a persisted resource. Fails silently.

Example:

Return The content of the file

Carbon.FileContent.resourceHash(resource, length)

Returns the hash value from the file content of a persisted resource. Fails silently.

Example:

Expression Result
Carbon.FileContent.resourceHash(q(node).property('file')) '1d62f5a5'
Carbon.FileContent.resourceHash(q(node).property('file'), 20) '1d62f5a55ad5e304d60d'

Return The hash value from the content of the file

Tailwind Helper

Tailwind.merge(mixed1, mixed2, mixedN)

This helper allows you to merge multiple Tailwind CSS classes and automatically resolves conflicts between them without headaches. Render all arguments as classNames and apply conditions if needed. Merge strings and arrays to a string with unique values, separated by an empty space.

All arguments of the eel helper are evaluated and the following rules are applied:

It is based on tailwind-merge-php.

Examples:

Expression Result
Tailwind.merge('w-8 h-8 rounded-full rounded-lg') 'w-8 h-8 rounded-lg'
Tailwind.merge(['w-8 rounded-full'], 'rounded-lg', 'h-8') 'w-8 rounded-lg h-8'
Tailwind.merge(null, null, {}, []) null
Tailwind.merge('one', ['one', 'two'], {three: true, four: false} 'one two three'

Return The merged string

AlpineJS Helper

AlpineJS.object(arg1, arg2, ..argN)

Generate an object for AlpineJS directive x-data. Supports nested arrays. You could do the same with Json.stringify(), but this function is shorter, as AlpineJS accepts objects and easier to write and read.

Examples:

Expression Result
AlpineJS.object({effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) '{effect:'slide',spaceBetween:12,loop:true,navigation:null}'
AlpineJS.object({nested: {value: true, nulled: null}}) '{nested:{value:true,nulled:null}}'

Return The JavaScript object as string

AlpineJS.function(name, arg1, arg2, ..argN)

Generate a function call for AlpineJS. More info. Supports nested arrays. In named arrays ({first:1,second:null}) null get filtered out, but in list arrays ([1,null]) and in plain values the will stay.

Examples:

Expression Result
AlpineJS.function('slider', {effect: 'slide', spaceBetween: 12, loop: true, navigation: null}) 'slider({effect:'slide',spaceBetween:12,loop:true})'
AlpineJS.function('slider', 'one', 1, false, null, ['string', 2, null]) 'slider('one',1,false,null,['string',2,null])'
AlpineJS.function("vote", 4) 'vote(4)'

Return The string for the x-data function call

AlpineJS.magic(name, arg1, arg2, ..argN)

Generate a call for a magic function for AlpineJS.. Supports nested arrays. In named arrays ({first:1,second:null}) null get filtered out, but in list arrays ([1,null]) and in plain values the will stay.

Examples:

Expression Result
AlpineJS.magic('dispatch', 'notify') '$dispatch('notify')'
AlpineJS.magic('$dispatch', 'notify', { message: 'Hello World!' }) '$dispatch('notify',{message:'Hello World!'})'
AlpineJS.magic('dispatch', 'notify', { message: true, nested: {value: true} }) '$dispatch('notify',{message:'Hello World!'})'

Return The string for the magic function call

AlpineJS.expression(value)

Use this to pass a javascript expression inside of the AlpineJS.object, AlpineJS.function or AlpineJS.magic helper

Examples:

Expression Result
AlpineJS.object({theme: AlpineJS.expression("localStorage.theme\|\|'system'"), show: true}) '{theme:localStorage.theme\|\|'system',show:true}'
AlpineJS.function('themeSwitcher', {theme: AlpineJS.expression("localStorage.theme\|\|'system'") 'themeSwitcher({theme:localStorage.theme\|\|'system',show:true})'

String Helper

Carbon.String.BEM(block, element, modifiers)

Generates a string with BEM classes. The modifiers property can be a string (for one modifier), an array (e.g. ['one', 'two']), or an array with keys and values. If you have an array with keys and values (like a Fusion DataStructure) and the value is true, the key's name gets used for the modifier.

Return The string

Carbon.String.urlize(string)

Generates a slug of the given string

Examples:

Expression Result
Carbon.String.urlize('Hello World') 'hello-world'
Carbon.String.urlize('Ä_ÖÜ äöü') 'ae-oeue-aeoeue'

Return The converted string

Carbon.String.minifyJS(javascript)

Minifies JavaScript so that it can be delivered to the client quicker.

Return The minified JavaScript

Carbon.String.minifyCSS(javascript)

Minifies CSS so that it can be delivered to the client quicker.

Return The minified CSS

Carbon.String.toPascalCase(string)

Convert strings to PascalCase.

Examples:

Expression Result
Carbon.String.toPascalCase('hello-world') 'HelloWorld'
Carbon.String.toPascalCase('hello world') 'HelloWorld'
Carbon.String.toPascalCase('Hello World') 'HelloWorld'

Return The converted string

Carbon.String.toCamelCase(string)

Convert strings to camelCase.

Examples:

Expression Result
Carbon.String.toCamelCase('hello-world') 'helloWorld'
Carbon.String.toCamelCase('hello world') 'helloWorld'
Carbon.String.toCamelCase('Hello World') 'helloWorld'

Return The converted string

Carbon.String.convertCamelCase(string, separator)

Convert CamelCaseStrings to hyphen-case-strings

Examples:

Expression Result
Carbon.String.convertCamelCase('HelloWorld') 'hello-world'
Carbon.String.convertCamelCase('HelloWorld', '_') 'hello_world'
Carbon.String.convertCamelCase('HelloWorld', '') 'helloworld'

Return The converted string

Carbon.String.convertToString(input, separator)

Helper to make sure to get a string back.

Examples:

Expression Result
Carbon.String.convertCamelCase(' helloworld ') 'helloworld'
Carbon.String.convertCamelCase([' hello', ' world']) 'hello world'
Carbon.String.convertCamelCase([' hello', ' world'], '-') 'hello-world'

Return The converted string

Carbon.String.nl2br(string, separator)

Replace all newlines with an <br>.

Examples:

Expression Result
Carbon.String.nl2br('hello\nworld') 'hello<br>world'
Carbon.String.nl2br('hello\nworld', ' - ') 'hello - world'

Return The converted string

Carbon.String.removeNbsp(string)

Replace non-breaking spaces and double spaces with a normal space.

Examples:

Expression Result
Carbon.String.removeNbsp(' hello world') 'hello world'
Carbon.String.removeNbsp('hello world') 'hello world'

Return The converted string

Carbon.String.classNames(mixed1, mixed2, mixedN)

Render all arguments as classNames and apply conditions if needed. Merge strings and arrays to a string with unique values, separated by an empty space.

All arguments of the eel helper are evaluated and the following rules are applied:

Examples:

Expression Result
Carbon.String.classNames('', 'one') 'one'
Carbon.String.classNames(['one two three'], ['one', 'four']) 'one two three four'
Carbon.String.classNames(null, false, [null], {one: false}) null
Carbon.String.classNames('one two three', ['one', 'four']) 'one two three four'
Carbon.String.classNames('one', {two: true, three: false }) 'one two'

Return The merged string

Carbon.String.splitIntegerAndString(string)

Split a string into an array width integers and strings. Useful for animations.

Examples:

Expression Result
Carbon.String.splitIntegerAndString('1000+ customers') [1000, '+ customers']
Carbon.String.splitIntegerAndString('24/7 reachability') [24, '/', 7, ' reachability']
Carbon.String.splitIntegerAndString('0 issues') [0, ' issues']
Carbon.String.splitIntegerAndString('') []
Carbon.String.splitIntegerAndString(null) []
Carbon.String.splitIntegerAndString(100) [100]

Return The string, splitted into an array of integers and strings

Carbon.String.phone(phoneNumber, defaultCountryCode, prefix)

Helper to convert phone numbers to a compatible format for links

Examples:

Expression Result
Carbon.String.phone(' 079 123 45 67 ') 'tel:0791234567'
Carbon.String.phone('+41 (0) 79 123/45/67') 'tel:0041791234567'
Carbon.String.phone('079 123 45 67', '+41') 'tel:0041791234567'
Carbon.String.phone('079 123 45 67', null, null) '0791234567'
Carbon.String.phone(' / (0) ') null

Return The phone number, optimized for links

Carbon.String.isValidEmail(emailAddress)

Checks if the string is a valid email address

Examples:

Expression Result
Carbon.String.isValidEmail('') false
Carbon.String.isValidEmail('Some text') false
Carbon.String.isValidEmail('[email protected]') true

Carbon.String.replaceOnce(string, search, replace)

Helper to replace the first occurrence of a string.

Examples:

Expression Result
Carbon.String.replaceOnce('Foo Bar Foo', 'Foo', 'X') 'X Bar Foo'
Carbon.String.replaceOnce('Foo Bar Foo', 'Foo ') 'Bar Foo'

Returns the string with one occurrence replaced

Number Helper

Carbon.Number.format(number, decimals, dec_point, thousands_sep)

Format a number with grouped thousands. If decimals is set to null, it returns as many as needed decimals.

Carbon.Number.formatLocale(number, decimals, locale)

Format a localized number with grouped thousands. If decimals is set to null, it returns as many as needed decimals.

Carbon.Number.decimalDigits(number)

Get number of decimal digits.

Carbon.Number.pxToRem(value, fallback)

Convert a pixel value to rem

Examples:

Expression Result
Carbon.Number.pxToRem('') '0'
Carbon.Number.pxToRem('8px') '0.5rem'
Carbon.Number.pxToRem(16) '1rem'
Carbon.Number.pxToRem(0) '0'
Carbon.Number.pxToRem(false, 32) '2rem'
Carbon.Number.pxToRem(null, '16px') '1rem'

Returns a string with the converted value

Backend Helper

Carbon.Backend.language()

Returns the language from the interface

Carbon.Backend.translate(id, originalLabel, arguments, source, package, quantity, locale)

Get the translated value (in the language of the interface) for an id or original label. If the only id is set and contains a translation shorthand string, translate according to that shorthand.

In all other cases: Replace all placeholders with corresponding values if they exist in the translated label.

Returns the translated label or source label / ID key

Installation

Carbon.Eel is available via packagist. Just run

Credits

Some of the Eel helpers were inspired and or copied from punkt.de


All versions of eel with dependencies

PHP Build Version
Package Version
Requires php Version ^8.1
neos/flow Version ^7.0 || ^8.0 || ^9.0
behat/transliterator Version ^1.2
yieldstudio/tailwind-merge-php Version ^0.0.3
matthiasmullie/minify Version ^1.3
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 carbon/eel contains the following files

Loading the files please wait ....