Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add standard icons #21

Open
gsouf opened this issue Oct 9, 2015 · 0 comments
Open

Add standard icons #21

gsouf opened this issue Oct 9, 2015 · 0 comments

Comments

@gsouf
Copy link
Owner

gsouf commented Oct 9, 2015

We can make use of standard icons.

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

  • on the server side with custom icon printer implementation
  • on the client side with service like fontello

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

  • keep it standard on the form construction and changeable at the render timer
  • make possible to implement icons anywhere we can put html string
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant