View Issue Details

IDProjectCategoryView StatusLast Update
15047Feature requests[All Projects] Pluginspublic2019-07-26 19:25
ReporterDenisChenu Assigned ToLouisGac  
PrioritynoneSeverityfeature 
Status resolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.0 
Summary15047: Create an helper (in API or event) to allow adding twig function
Description

We can currently create a plugin to add function
See : snippet : https://gitlab.com/snippets/1875429

It work, but it's not in API, then can be great to have a clean API function for this ?

Additional Information

In init : it work, in afterPluginLoad : don't seems to work.
Mauybe in beforeControllerAction it can work ?

TagsNo tags attached.

Activities

DenisChenu

DenisChenu

2019-07-15 16:03

developer   ~52887

Last edited: 2019-07-15 16:05

View 5 revisions

@LouisGac : since you work on twig, think it best if you choose the way to do this :)

Oups, lack of a file in snippet … but here : really easy

<?php

function helloWorld($string) {
    return 'Hello $string';
}

Maybe class need extend Twig_Extension by default too

DenisChenu

DenisChenu

2019-07-26 19:25

developer   ~53027

https://github.com/LimeSurvey/LimeSurvey/commit/cec66adb1a74a518525e6a4fc4fe208c50595067

Issue History

Date Modified Username Field Change
2019-07-15 16:02 DenisChenu New Issue
2019-07-15 16:02 DenisChenu Status new => assigned
2019-07-15 16:02 DenisChenu Assigned To => LouisGac
2019-07-15 16:02 DenisChenu Summary Create an helper to allow adding twig function => Create an helper (in API or event) to allow adding twig function
2019-07-15 16:03 DenisChenu Note Added: 52887
2019-07-15 16:04 DenisChenu Note Edited: 52887 View Revisions
2019-07-15 16:04 DenisChenu Note Edited: 52887 View Revisions
2019-07-15 16:04 DenisChenu Note Edited: 52887 View Revisions
2019-07-15 16:05 DenisChenu Note Edited: 52887 View Revisions
2019-07-26 19:25 DenisChenu Status assigned => resolved
2019-07-26 19:25 DenisChenu Resolution open => fixed
2019-07-26 19:25 DenisChenu Fixed in Version => 3.0
2019-07-26 19:25 DenisChenu Note Added: 53027