Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/heimrichhannot/contao-code-generator-bundle

Generate code from backend or programmatically.
https://github.com/heimrichhannot/contao-code-generator-bundle

contao

Last synced: about 1 month ago
JSON representation

Generate code from backend or programmatically.

Awesome Lists containing this project

README

        

# Code Generator

This module offers comfortable code generation based on separated configurations for Contao.

![alt Preview](doc/screenshot.png)

*Code config preview*

![alt List view](doc/screenshot2.png)

*List view*

## Features

- offers a code configuration entity
- offers a service to create codes
- criteria:
- prevent ambiguous characters
- prevent double codes
- limit to certain alphabets (numbers, capitals, ...)
- add rules like "at least one number"
- one-click-creation of an arbitrary number of codes

## Developers

```php
use HeimrichHannot\CodeGeneratorBundle\Code\Criteria;
use HeimrichHannot\CodeGeneratorBundle\Code\Generator;

class Example
{
public function __construct(
private readonly Generator $generator
) {}

public function generatePasswort(): string
{
$criteria = new Criteria();
$criteria->allowSymbols = true;
$criteria->length = 14;
$criteria->requireNumbers = true;
$criteria->requireSymbols = true;

return $this->generator->generate($criteria);
}
}
```