Skip to content

zivoradantonijevic/yii-dummy-image

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

yii-dummy-image

YII Dummy Image extension.

It pretends to be very simple. Just generates empty image with specified text and color attributes.

Accept those parameters (either $_GET, or $params if called directly)

    $params['color'] = '000000';
    $params['bg'] = 'ffffff';
    $params['text'] = 'Hello World';
    $params['size'] = '200x200' ;  or $params['size'] = '200'; 
    $params['type'] = 'png';

How to use:

/** Using as action **/
public function actions()
    {
        return array(
            'nophoto' => array('class' => 'ext.dummyImage.actions.DummyImageAction', 
                         'defaultText' => 'No Photo', 
                         'defaultBackground'=>'eeeeee',
                         'defaultType'=>'png',
                         'defaultColor'=>'000000'
                         )
        );
    }



/** Using with inline component **/
$dummy = Yii::createComponent(
          array(
              'class' => 'ext.dummyImage.EDummyImage',
              'defaultText' => 'No Photo', 
              'defaultBackground'=>'eeeeee',
              'defaultType'=>'png',
              'defaultColor'=>'000000'
          )
      );
  $dummy->image();

    
  /** Using as normal component **/
  ...
  'components'=>array(
  ...
  'dummy'=>array(
                'class' => 'ext.dummyImage.EDummyImage',
                'defaultText' => 'No Photo', 
                'defaultBackground'=>'eeeeee'
            )
  ...
  )
  Yii::app()->dummy()->image()

About

YII 1 Dummy Image

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages