FigDice, un Templating System efficace et original / GLMF-158 / GNU/Linux Magazine / Connect

/FigDice-un-Templating-System-efficace-e

  • FigDice, un Templating System efficace et original
    http://connect.ed-diamond.com/GNU-Linux-Magazine/GLMF-158/FigDice-un-Templating-System-efficace-et-original

    FigDice
    http://figdice.org/en/intro.html

    The fundamental principle of FigDice is to make the view itself responsible for calling the data it needs. This means FigDice places the view at the centre of the application and only the screens know the services invoked to produce them.

    The controller no longer reassembles the data from the various services to inject them into a template - the template itself invokes the services, manipulates their data and decides which are to be presented and how.

    Un moteur de #template pour #PHP qui inverse la responsabilité MVC habituelle, où le contrôleur passe les données à la vue (cf Smarty etc).
    Ici, c’est la vue elle même qui va chercher les données dont elle a besoin.

    Ça ressemble beaucoup à ce que fait #SPIP, mais avec un formalisme xml valide.

    Exemple : une boucle sur des tweets

    <fig:feed class="TwitterFeed" target="tweets" />
    <ul>
    <li fig:walk="tweets" fig:text="body" />
    </ul>