![]() |
Foreach in plugin
So I am trying to use a foreach in my plugin and call it in my template with a variable, since my foreach is open it's breaking my product. How can I go about calling a foreach and include it in my template?
My before product, raw php: PHP Code:
so I have my plugin like this (and yes the other variables are defined, this is just where the is) PHP Code:
HTML Code:
$drc_4ch-st Code:
$drc_rep |
I am no expert but …
1 - there is an extra semicolon at line 2 of your php code 2 - PHP variables, I think underscore should be used not dashes |
Also PHP doesn't have any type of macro support like that (unlike C++ macro definitions using #define). You can't assign portions of a function to a variable and then execute the function as usual by calling the PHP variables in order.
|
Template:
Code:
<div id="something"> hook : parse_templates PHP Code:
|
Quote:
so my end results ended up being along these lines: PHP Code:
|
All times are GMT. The time now is 12:02 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|