This is short codegenerator. Can be used for various purposes
This is short codegenerator. Can be used for various purposes, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-dist dastanaron/codegenerator "*"
or add, (*4)
"dastanaron/codegenerator": "*"
to the require section of your composer.json
file., (*5)
To use, you must create an instance of the class and call the method generate(), (*6)
use dastanaron\extension\CodeGenerator; $codegen = new CodeGenerator(); echo $codegen->generate();
To adjust the length of the code, you need to use the length property., (*7)
Property $length default value = 6;, (*8)
use dastanaron\extension\CodeGenerator; $codegen = new CodeGenerator(); $codegen->length = 9; echo $codegen->generate();
The symbols for code generation are found in the properties $lat_symbols and $num_symbols., (*9)
This properties take values in the form of arrays., (*10)
So you can specify specific symbols to generate., (*11)
use dastanaron\extension\CodeGenerator; $codegen = new CodeGenerator(); $codegen->length = 9; $codegen->lat_symbols = ['a', 'b', 'c', 'd']; $codegen->num_symbols = [1, 2, 3, 4]; echo $codegen->generate();
For the default properties, see the class code., (*12)