Strict Standards: Redefining already defined constructor for class Object in /home1/ryansh/public_html/ryanhafer.info/cake/libs/object.php on line 54

Strict Standards: Non-static method Configure::getInstance() should not be called statically in /home1/ryansh/public_html/ryanhafer.info/cake/bootstrap.php on line 38
Ryan Hafer | CAKEPHP FX View Helper v01.00
Ryanhafer.info thumb

CAKEPHP FX View Helper v01.00

2/22/10

I have been wanting a method to easily create custom font headings on the fly. Using a cakephp helper I can easily accomplish this. Now all I have to do is enter my text with the handy cakephp FX view helper.

Download: http://www.ryanhafer.info/files/downloads/fx.zip

Install:
1 - Just place the extracted fx.php file in your app/views/helpers directory.
2 - create the directory app/fonts and add any .ttf files you want to use.
3 - Add "Fx" to the controller var $helpers array.

text2image (string $text, array $Options=array())

Creates the heading image as .png file and returns an image tag of the text value with options applied. Created images are cached in the /app/webroot/img/fx directory.

Default Options

"height"=>22, The height in pixels of the heading. Should generally be larger than  the font size.
"width"=>160, The width in pixels of the heading.
"font"=>"kremlin.ttf", The font to be used for the heading
"colorHex"=>"", Hex color of font. NOTE: setting Hex will override any RGB color.
"colorRGB"=>"139,35,35", RGB color of font.
"size"=>20, The font size in pixels of the heading.
"angle"=>0, The angle of the text output.
"style"=>'', The styling to be applied to the outputted image tag.
"shadow"=>true, Boolean for creating a 1 pixel drop shadow of the text.

Example:

<h1>
<?php

$fx->text2image("I love Design",array("style"=>"border:0px","font"=>"arialblack.ttf","colorHex"=>"C0C0C0"));

?>
</h1>

Read Comments

Jimmie Hansson
2010-12-14 12:11:29
 
Hi Ryan, Great helper it seems, but the file is missing from the blog? Could you perhaps repost it or change the uri of the file? Thanks a bunch,
Ryan Hafer
2010-12-15 07:02:51
 
The file should be back online now. Thanks, hope it's what you are looking for.
Jimmie Hansson
2010-12-15 12:13:23
 
Thanks a bunch! Great helper, was exactly what I was looking for.

Post A Comment

 
Switch themes | © 2017 RyanHafer.info. All Rights Reserved
xhtml validated css validated