Page MenuHomePhabricator

Use real (logic-less) templates to generate HTML
Closed, ResolvedPublic

Description

Author: jgonera

Description:
We could really use templates to untangle SkinMobile.php. Since we'll be using Mustache[1] templates in JavaScript (or specifically the Hogan[2] implementation), we could also consider using them on the server side.

Logic-less templates enforce separation between logic and presentation because you simply can not write any code inside them. Separate files for HTML and PHP code for the win!

[1] http://mustache.github.com/
[2] http://twitter.github.com/hogan.js/


Version: unspecified
Severity: enhancement

Details

Reference
bz44130

Event Timeline

bzimport raised the priority of this task from to Low.Nov 22 2014, 1:26 AM
bzimport set Reference to bz44130.

I've experimented with this and it's beautiful:
https://github.com/jdlrobson/Minerva/blob/evenmorevanilla/Minerva.php#L72

We should probably drive work on the skin and then create a RFC to see how people feel about bringing in an external library..

Related URL: https://gerrit.wikimedia.org/r/69756 (Gerrit Change I742eb3587f3736a9c1932bc86ee59c4fe26ca434)

We will be exploring this as part of the UI standardisation project (templating in core)

This is done now! Thanks @kaldari