Skip to content

Latest commit

 

History

History
24 lines (22 loc) · 888 Bytes

README.md

File metadata and controls

24 lines (22 loc) · 888 Bytes

CakePHP 2.x Gravatar Helper

###A Gravatar Helper for CakePHP 2.x

A really quick Gravatar Helper for CakePHP 2.x - We allow users to upload images to their profiles in order to replace the standard placeholder image / auto generated Gravatar Image

Usage:

  1. Add 'Gravatar' to your helper array in your controller
  2. Call it like this:
$this->Gravatar->displayProfilePicture($user['UserDetail']['photo'], $user['User']['email']);

Replace the variables as is required by your system, if no email is provided then the Gravatar cannot be created and a placeholder will be used.

You can also just generate a Gravatar URL directly by calling:

$this->Gravatar->get_gravatar($user['User']['email']);

See the PHPDoc in the code for other parameters you can use (including one to generate a full IMG tag)