lagan/property-hashid

Controller for the Lagan hashid property.

v1.0.0 2017-01-16 20:49 UTC

This package is auto-updated.

Last update: 2024-03-29 03:31:47 UTC


README

Lagan

Lagan Hashid Property Controller

Controller for the Lagan Hashid property.
Generate YouTube-like ids based on the conten object id's. Use it when you don't want to expose your database ids to the user. A Hashid is only set on creation of the content object and cannot be edited. Uses the Hashids PHP library. Optionally a salt, padding and alphabet for the Hasid can be set in the property array.
Salt will make the id's unique for that salt.
Padding sets the length of the id.
Alphabet defines the characters that can be used for the id, with a minimum of 16 characters.

Example:

[
	'name' => 'uid',
	'description' => 'U.I.D.',
	'autovalue' => true,
	'salt' => 'some salt to make the hasid unique',
	'padding' => 10,
	'alphabet' => 'abcdefghABCDEFGH',
	'type' => '\Lagan\Property\Hashid',
	'input' => 'readonly'
]

To be used with Lagan. Lagan lets you create flexible content objects with a simple class, and manage them with a web interface.

Lagan is a project of Lútsen Stellingwerff.