String processing in template?

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
CentaurAtlas
Registered User
Posts: 50
Joined: Sun Dec 02, 2007 5:39 pm
Contact:

String processing in template?

Post by CentaurAtlas »

Hi,
I don't think this is possible from my reading, but is basic string processing possible in a template? e.g. to grab all the characters after a slash or colon or ...

I don't think that is possible, but as an alternative, is it possible to access the template variables inside the

Code: Select all

	<!-- PHP -->
	<!-- ENDPHP -->
block? (I couldn't find an example of doing that. It is really just one line of php code to strip out part of a string so while an extension might be preferable, it seems like a lot of overkill so thought I'd ask.)

Thanks!
nicofuma
3.2 Release Manager
3.2 Release Manager
Posts: 546
Joined: Sun Apr 13, 2014 1:47 am
Location: Grenoble - France

Re: String processing in template?

Post by nicofuma »

You have a few functions (http://twig.sensiolabs.org/documentation) but you can't do that. But if you want you can create and register a new Twig extension to add a such function.
Member of phpBB Development-Team
No Support via PM
CentaurAtlas
Registered User
Posts: 50
Joined: Sun Dec 02, 2007 5:39 pm
Contact:

Re: String processing in template?

Post by CentaurAtlas »

That is what I thought - thanks for the link. I'll dig into it!
Thanks!
Post Reply

Return to “Extension Writers Discussion”