Opened 10 months ago

Closed 8 months ago

Last modified 6 months ago

#4019 closed New feature (fixed)

Migrate our templating engine from Smarty to Twig

Reported by: matt Owned by: halfdan
Priority: major Milestone: 2.0 - Piwik 2.0
Component: UI - UX (AngularJS, twig, less) Keywords:
Cc: Sensitive: no

Description

Smarty was nice, but now Twig is the real deal, and we would love to migrate to Twig.

As part of Piwik 2.0, as we increase the minimum PHP version to 5.3, we can now use Twig.

Thanks to the amazing work by @halfdan this is becoming a reality!

Change History (29)

comment:1 Changed 10 months ago by matt (mattab)

In 0ddd15af0d3a4130856648def938bd74c13013b3:

Removing final |raw from codebase

Refs #4019

comment:2 Changed 10 months ago by matt (mattab)

In 7bbf3052d1e34cc280a391d21b1086e328774b40:

Reverting my commit where I removed all |raw per @halfdan feedback
Instead we should manually add the missing |raw...
Refs #4019

comment:5 Changed 10 months ago by matt (mattab)

In 6ac63c26a4b1486aa364d4cc7ca3938b2f3e2f4f:

  • Fixing SitesManager page
  • Enabling debug on twig so we can use {{ dump(var) }} function

Refs #4019

comment:9 Changed 10 months ago by matt (mattab)

In 8f6d151fcb731b26c08882ec65eb3f81242c4ea1:

  • Adding htaccess to allow loading SVG+PNG logos on Settings page

Refs #4019

comment:10 Changed 10 months ago by matt (mattab)

In 12e81aebb0e69d6ecc8be4ceb4eff122891259c5:

  • admin screens,
  • removed the remains of CDN/jquery feature

Refs #4019

comment:15 Changed 10 months ago by matt (mattab)

In b814322485f8808c85bd98c0902d3bd8b34783de:

Removing Smarty strings from codebase, fixing install
Adding twig to LEGALNOTICE
Refs #4019

comment:16 Changed 10 months ago by matt (mattab)

In 60e3b96370defabb1231af84aa732ca1139d40a3:

  • removing most mentions to "tpl"

Refs #4019

comment:17 Changed 10 months ago by matt (mattab)

In a62f1c16b45dc3c287a561f9e7b6246aa31f4e7d:

  • Converting CLI templates to twig
  • deprecating View::factory, simplify constructor

Refs #4019

comment:20 Changed 10 months ago by matt (mattab)

In affa786e87b66800251294816dff40bf58f05e8d:

  • Removing |count as I didn't notice |length was already used

Refs #4019

comment:21 Changed 10 months ago by matt (mattab)

In 63aa1dedd0a07441fb8cdddb50137f4804fc0962:

  • Cell used to be "spaceless" so restoring, just in case this could cause hidden regression...

Refs #4019

comment:22 Changed 10 months ago by matt (mattab)

In 28b9f12d6b22f73c11a43dd08156b519899224ec:

  • During the big merge I noticed some code was duplicated in userCountry.js

Refs #4019

comment:23 Changed 10 months ago by matt (mattab)

In 84bf3a5eab6ae6529690460e044fd7c908305b71:

  • themes or plugins should not have the php requirement in JSON, it should only be in "Piwik installation check".

... unless some non-core plugins would indeed require more recent than 5.3 (but core plugins will always work if Piwik was successfully installed)
Refs #4019

comment:24 Changed 10 months ago by matt (mattab)

In 916848085adcc6504c9cb1757e8fc9cba3eee468:

  • Enabling Twig 'strict_variables' so that we write best code possible, and learn early if some tpl code is not valid. Fixing few bugs that this uncovered
  • refactoring the percent column label in getPercentVisitColumn()
  • removing indexBeforeMenu and putting directly in parent template

Refs #4019

comment:25 Changed 10 months ago by matt (mattab)

In 7bae34475efd330343d6dd477a3b610074676c27:

  • Restoring the cache buster output filter which was lost at some point

Refs #4019

comment:26 Changed 10 months ago by matt (mattab)

In 00ef553551ca915783316854cd502a1204b4ce16:

  • Enabling templates compiled cache. @halfdan, was there any reason it was disabled?

Refs #4019

comment:27 Changed 10 months ago by matt (mattab)

In 1b35b77d93df7d28c33a3d5483829d41343e9227:

  • Fixing some missing |raw using global search \{\{.*<{1,}.*\}\}

Refs #4019

comment:28 Changed 8 months ago by matt (mattab)

  • Resolution set to fixed
  • Status changed from new to closed

Twig support is now fully working. awesome!

comment:29 Changed 6 months ago by matt (mattab)

  • Priority changed from normal to major
Note: See TracTickets for help on using tickets.