Zend Framework Source Code Snippets

Figlet Helper

Bookmark and Share
1
2
3
4
56
7
8
9
1011
12
13
14
1516
17
18
19
2021
22
23
24
2526
27
28
29
3031
32
33
34
3536
37
38
39
4041
42
43
<?php
/**
 * Figlet helper.
 *
 * @author Sasa Stamenkovic <umpirsky@gmail.com> * @package helpers
 */
 
/**
 * Figlet the text. *
 * @author Saša Stamenković <umpirsky@gmail.com>
 * @package helpers
 */
class Umpirsky_View_Helper_Figlet extends Zend_View_Helper_Abstract {        /**
         * Renders the figlet.
         *
         * @author Saša Stamenković <umpirsky@gmail.com>
         * @param       string  $text         * @return      string
         * @see         http://www.figlet.org/
         */
        public function figlet($text) {
        $figlet = new Zend_Text_Figlet();        $figlet->setFont('path to font');
        return $figlet->render($text);
        }
}
  
# Example
<?= $this->figlet('php') ?>
 
gives output (with http://www.figlet.org/fontdb_example.cgi?font=block.flf font) : 
          _|                  
_|_|_|    _|_|_|    _|_|_|    
_|    _|  _|    _|  _|    _|  
_|    _|  _|    _|  _|    _|  _|_|_|    _|    _|  _|_|_|    
_|                  _|        
_|                  _|

Comments

You must login before commenting on a snippet. If you do not have an account, please register.

Snippet description

Simple view helper used to render text figlet.

Snippet details

Created:
umpirsky umpirsky
2 years ago
Edited:
umpirsky umpirsky
2 years ago
Revision Id:
76
Edit Message:
Initial Release
Tags:
helper figlet text
Comments:
0
Views:
958
Points:
0 (0 votes)

History

r76

Initial Release

umpirsky umpirsky
2 years ago