2017 © Pedro Peláez
 

yii2-extension yii2-haikunator

Generate Heroku-like random names to use in your Yii2 php applications.

image

derekisbusy/yii2-haikunator

Generate Heroku-like random names to use in your Yii2 php applications.

  • Monday, June 27, 2016
  • by derekisbusy
  • Repository
  • 1 Watchers
  • 0 Stars
  • 66 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

yii2-haikunator

Build Status Latest Version Coverage Status Packagist, (*1)

Generate Heroku-like random names to use in your PHP applications., (*2)

This package has been forked from the original HaikunatorPHP repository and modified to work with the Yii2 autoloader., (*3)

Installation

composer require derekisbusy/yii2-haikunator

Usage

Haikunator is pretty simple., (*4)

use derekisbusy\haikunator\Haikunator;

// default usage
Haikunator::haikunate() // => "wispy-dust-1337"

// custom length (default=4)
Haikunator::haikunate(["tokenLength" => 6]) // => "patient-king-887265"

// use hex instead of numbers
Haikunator::haikunate(["tokenHex" => true]) // => "purple-breeze-98e1"

// use custom chars instead of numbers/hex
Haikunator::haikunate(["tokenChars" => "HAIKUNATE"]) // => "summer-atom-IHEA"

// don't include a token
Haikunator::haikunate(["tokenLength" => 0]) // => "cold-wildflower"

// use a different delimiter
Haikunator::haikunate(["delimiter" => "."]) // => "restless.sea.7976"

// no token, space delimiter
Haikunator::haikunate(["tokenLength" => 0, "delimiter" => " "]) // => "delicate haze"

// no token, empty delimiter
Haikunator::haikunate(["tokenLength" => 0, "delimiter" => ""]) // => "billowingleaf"

// custom nouns and/or adjectives
Haikunator::$ADJECTIVES = ["red", "green", "blue"];
Haikunator::$NOUNS = ["reindeer"];
Haikunator::haikunate(); // => "blue-reindeer-4252"

Options

The following options are available:, (*5)

Haikunator::haikunate([
  "delimiter" => "-",
  "tokenLength" => 4,
  "tokenHex" => false,
  "tokenChars" => "0123456789"
]);

// get/set nouns or adjectives
Haikunator::$ADJECTIVES
Haikunator::$NOUNS

If tokenHex is true, it overrides any tokens specified in tokenChars, (*6)

Contributing

Everyone is encouraged to help improve this project. Here are a few ways you can help:, (*7)

Other Languages

Haikunator is also available in other languages. Check them out:, (*8)

  • Node: https://github.com/Atrox/haikunatorjs
  • .NET: https://github.com/Atrox/haikunator.net
  • Python: https://github.com/Atrox/haikunatorpy
  • Java: https://github.com/Atrox/haikunatorjava
  • Dart: https://github.com/Atrox/haikunatordart
  • Ruby: https://github.com/usmanbashir/haikunator
  • Go: https://github.com/yelinaung/go-haikunator

The Versions

27/06 2016

dev-master

9999999-dev https://github.com/derekisbusy/haikunatorphp

Generate Heroku-like random names to use in your Yii2 php applications.

  Sources   Download

GPLv3

by Avatar Atrox

user yii2 generator random username nickname