#103810add a general viewhelper which allow you to use nearly all php-function for manipulating strings in fluid
Description
- I often needs a explode-viewhelper, which convert a comma-separated list into an array.
- I need sometimes a viewhelper which could convert a string to a string in lower case.
- …
I wrote the viewhelper `convert`. The viewhelper allows the integrator, to use at least nearly any of the powerful php function for string-manipulation.
The behavior is a combination of <f:alias> and <f:variable>. It depends on the way how you define the string which should be manipulated.</f:variable></f:alias>
Example:
<!-- stores the result of the complex php-function explode($limiter,$string, $limit) in a global fluid-variable -->
<f:convert phpfunc="explode" value="php,javascript,java,c++,ada,prolog,lisp,fortran," prev="{0:','} post="{0:3}" as="langList" />
<f:for each="{langList}" as="progLanguage">
<div>{progLanguage}</div>
<f:for>
<!-- output:
<div>php</div>
<div>javascript</div>
<div>java,c++,ada,prolog,lisp,fortran,</div>
-->
<!-- defines the result of the complex php-function explode($limiter,$string, $limit) only for the nested html via 'local="1"' -->
<f:convert phpfunc="explode" value="php,javascript,java,c++,ada,prolog,lisp,fortran," prev="{0:','} post="{0:3}" as="langList" local="1" >
<f:for each="{langList}" as="progLanguage">
<div>{progLanguage}</div>
<f:for>
</f:convert>
<!-- output:
<div>php</div>
<div>javascript</div>
<div>java,c++,ada,prolog,lisp,fortran,</div>
-->Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.
Files 1
History 2
-
Georg Ringer commented and changed status
NewRejected 06/10/24, 20:45 -
Garvin Hicking commented 06/10/24, 20:53
Hey Dieter,
thanks for creating this issue! I am rejecting this feature request for the following reasons:
feel free to contact me via slack if you want to discuss the current viewhelper and their limitations.