CakePHP helper to generate ascii art text from a string.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.gitignore
AsciiHelper.php
LICENSE
README.md

README.md

CakePHP-Ascii-Text-Helper

A CakePHP Helper to generate ascii art text from a string. Utilizes the API at http://artii.herokuapp.com/.

#Requirements# *PHP 4,5
*HttpSocket
*CakePhp 2+

#Installation#

  1. Copy AsciiHelper.php to /App/View/Helper
  2. Edit your /app/Controller/AppController.php
class AppController extends Controller {
	public $helpers = array('Ascii');
}

#Configuration# Change the default font by picking one from the fonts list and setting it on line 7.

const default_font = 'cosmic';

#Example# Draw Text with default font.

echo $this->Ascii->make('Ascii Text');

Creates:

  :::.     .::::::.   .,-:::::  ::::::  ::::::::::::.,::::::    .,::      .:::::::::::::
  ;;`;;   ;;;`    ` ,;;;'````'  ;;;;;;  ;;;;;;;;'''';;;;''''    `;;;,  .,;; ;;;;;;;;''''
 ,[[ '[[, '[==/[[[[,[[[         [[[[[[       [[      [[cccc       '[[,,[['       [[     
c$$$cc$$$c  '''    $$$$         $$$$$$       $$      $$""""        Y$$$P         $$     
 888   888,88b    dP`88bo,__,o, 888888       88,     888oo,__    oP"``"Yo,       88,    
 YMM   ""`  "YMmMY"   "YUMMMMMP"MMMMMM       MMM     """"YUMMM,m"       "Mm,     MMM  
 

Draw Text with specific font.

echo $this->Ascii->make('Ascii Text', 'larry3d');

Creates:

 ______                              ______               __      
/\  _  \                  __  __    /\__  _\             /\ \__   
\ \ \L\ \    ____    ___ /\_\/\_\   \/_/\ \/    __   __  _\ \ ,_\  
 \ \  __ \  /',__\  /'___\/\ \/\ \     \ \ \  /'__`\/\ \/'\ \ \/  
  \ \ \/\ \/\__, `\/\ \__/\ \ \ \ \     \ \ \/\  __/\/>   

Get Font List

echo $this->Ascii->fonts();

Each string will display very differently between fonts. If you wish to preview your text in all fonts, use the following function.

echo $this->Ascii->preview_all('Ascii Text');

#Change History# CakePHP Ascii Text Helper v.1 - 2014-04-14
*Initial Committ