gsouf / UForm

php form library
Other
0 stars 2 forks source link

Add standard icons #21

Open gsouf opened 9 years ago

gsouf commented 9 years ago

We can make use of standard icons.

Icon would match the font awesome names, that would be customisable

First think usage example:

    use UForm\Icon\IconBuilder:
    $icon = new IconBuilder();
    Builder::init()->text()->leftAddon($icon->search)

That would retour an object of class Icon:

     class Icon{

         protected $iconName;
         protected $printer;

         public function __construct ($iconName, IconPrinter $printer) { 
                 $this->iconName = $iconName;
                 $this->printer = $printer;
         }

         public function __toString () {
                 $this->printer->format($this->iconName);
         }
     }

The main concerns are