Skip to content

dator-zz/sfGravatarPlugin

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 

Repository files navigation

Installation

  1. Add this plugin to your project as Git submodules:

       $ git submodule add git://github.com/dator/sfGravatarPlugin.git plugins/sfGravatarPlugin
    
  2. Add this plugin to your ProjectConfiguration file:

     // config/ProjectConfiguration.class.php
     public function setup()
     {
         $this->enablePlugins(array(
             // ...
             'sfGravatarPlugin',
             // ...
         ));
     }
    
  3. Enable the helper in your settings.yml file

     // apps/frontend/config/settings.yml
     all:
       .settings:
         # ...
         standard_helpers:       [ ... , Gravatar]
    

Usage

All you have to do is use the helper like this example:

  echo gravatar_image_tag('[email protected]');

With parameters:

  echo gravatar_image_tag('[email protected]', 140, 'G', 'Picture avatar');

Or :

You can check if an email as a gravatar (warning, slow due to curl function)

  <?php if(gravatar_has_image('[email protected]')): ?>  
    <!-- -->
  <?php endif;?>

Available options: - size : the size of the avatar (default to 80px) - rating : is the type of content in the image (default to G) - default_image: the default image (default to null)

For more information, check the gravatar page : http://fr.gravatar.com/site/implement/images/

About

Enable Gravatar in your Symfony1.*.* Project

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages