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

Plugins #9

Open
augustohp opened this issue Dec 15, 2011 · 3 comments
Open

Plugins #9

augustohp opened this issue Dec 15, 2011 · 3 comments

Comments

@augustohp
Copy link
Member

Plugins are a way of adding a different behavior when decoration elements, examples of plugins are:

  • Custom rendered elements (The date/calendar element you just spoken on issue Decorator API #4)
  • Using a specific decorator
  • Escape HTML data

How designer could use them:

<div id="post-comments" class="respect-escape-html"></div>

Or we could use data attribute, but classes just seem a little bit better and we can use them as selectors also.
Waiting your considerations ...

@alganet
Copy link
Member

alganet commented Dec 15, 2011

Custom rendered elements are bad, since the designer would never see them before the developer did his part. Not sure how we solve this problem, but the designer should never rely on PHP to see how the template really are, this is the most critical flaw of every template engine out there.

Escaping and filtering seems good, we need to come up with real use cases.

@augustohp
Copy link
Member Author

Another real use cases:

  • EmptyDecorator - Used when no data is passed by the backend (There is no data to show in this table) or when the designer does not want the element to show when there is no data passed by the backend
  • TemplateDecorator - Used when some pre-defined element(s) by the designer are used by the Template (Ex: Zebra rows)

@augustohp
Copy link
Member Author

An idea is that a plugin is always an adapter or/and a decorator. Another ideas to plugins ...

  • l10n / i18n plugin
  • Asset manipulation (images as sprites, concat css and javascript)
  • Google Analytics plugin

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants