Yii 1.1: etextimage

This widget allows you to display the text as an image.

This widget allows you to display the text as an image.

Archive does not contain fonts. Place your preferred font in the folder /protected/extensions/ETextImage/fonts




  • Yii 1.0 or above


  • Extract the release file under protected/extensions/ETextImage


0) Place your preferred font in the folder /protected/extensions/ETextImage/fonts

1) Override CController::actions() and register an action of class ETextImageAction with ID 'textImage':

public function actions()
        return array(
                'class' => 'application.extensions.ETextImage.ETextImageAction',

2) In the controller view, insert a widget.

<?php $this->widget('application.extensions.ETextImage.ETextImage',
                              'textImage' => "(495)1234567",
                              'fontSize' => 10,
                              'fontFile' => 'tahoma',
                              'textImage' => "Super Puper Paratruper Text",
                              'fontSize' => 8,
                              'fontFile' => 'arial',

Change Log

March 30, 2010

  • Initial release.

Total 1 comment

#638 report it
Dana at 2010/04/02 01:37pm
Path issues

Very handy!

In the documentation, it would be good to specify the font file type required -- took me a little digging to figure out that I needed to call TTF fonts with the basename of the font and that my font needed to have a lowercase extension on it.

Also, it did not work by default with alternate path routines-- I had to alter the ETextimage.php run method as follows (now it will work no matter what configuration the application uses):

 * Renders the widget.
public function run()

    $base = $this->getController()->getId().'/'.$this->thisAction;
    $params = array( 'textImage'=>$this->textImage,

    echo CHtml::image( Yii::app()->createUrl( $base, $params )   ,'');

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: Other Open Source License
  • Developed by: kosenka
  • Category: Others
  • Votes: +1
  • Downloaded: 400 times
  • Created on: Mar 30, 2010
  • Last updated: Mar 30, 2010