Variable access/exchange in templates

Need some custom code changes to the phpBB core simple enough that you feel doesn't require an extension? Then post your request here so that community members can provide some assistance.

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Forum rules
READ: phpBB.com Board-Wide Rules and Regulations

NOTE: NO OFFICIAL SUPPORT IS PROVIDED IN THIS SUB-FORUM
Post Reply
RobiX
Registered User
Posts: 42
Joined: Thu Oct 05, 2017 9:59 am

Variable access/exchange in templates

Post by RobiX » Sun Dec 03, 2017 1:39 pm

in a template i have, e.g.,

Code: Select all

<div>
<!-- IF INDEX.0 neq "" -->
  <!-- PHP -->aPhpFunction({INDEX.0});<!-- ENDPHP --> //*
<!-- ENDIF -->
</div>

*how can i access the variable here? because doesnt work

User avatar
AmigoJack
Registered User
Posts: 5053
Joined: Tue Jun 15, 2010 11:33 am
Location: グリーン ヒル ゾーン
Contact:

Re: Variable access/exchange in templates

Post by AmigoJack » Mon Dec 04, 2017 10:29 am

RobiX wrote:
Sun Dec 03, 2017 1:39 pm
INDEX.0
Block variables must be in lowercase and names should not start with numbers (just like in any other language as well). In other words: make it at least index._0.

RobiX wrote:
Sun Dec 03, 2017 1:39 pm
<!-- PHP -->
Consider using the template system fully by calling PHP in your PHP files, not in your template files.
The worst thing about censorship is ███████████

Post Reply

Return to “phpBB Custom Coding”

Who is online

Users browsing this forum: david63, Ibedejo and 4 guests