Dr.CustUmz
05-01-2020, 01:24 PM
ok I have been out of the scene for a LONG time, I'm working on a new product, and im just having a huge brain fart.
Im trying to use php in a template I have created what I want to convert to a product in PHP, an example of my source is
<div class="blah">
<?php
$i=0;
foreach($result as $row) if ($i < 10+1) {
?>
<div class="thing">
<span class="stuff"><?php echo number_format($row['stuff']);?></span>
</div>
<?php $i +=1;
} ?>
</div>
I know I cant use php in a template of a product, but what I cant remember is how to create a variable that would equal the php so i can pull that into the template.
Im brain farting so hard.
Global Plugin:
$var = '$i=0; foreach($result as $row) if ($i < 10+1) {';
$var2 = 'echo number_format($row['stuff']);';
$var3 = '$i +=1; }';
Template
<div class="blah">
$var
<div class="thing">
<span class="stuff">$var2</span>
</div>
$var3
</div>
Im trying to use php in a template I have created what I want to convert to a product in PHP, an example of my source is
<div class="blah">
<?php
$i=0;
foreach($result as $row) if ($i < 10+1) {
?>
<div class="thing">
<span class="stuff"><?php echo number_format($row['stuff']);?></span>
</div>
<?php $i +=1;
} ?>
</div>
I know I cant use php in a template of a product, but what I cant remember is how to create a variable that would equal the php so i can pull that into the template.
Im brain farting so hard.
Global Plugin:
$var = '$i=0; foreach($result as $row) if ($i < 10+1) {';
$var2 = 'echo number_format($row['stuff']);';
$var3 = '$i +=1; }';
Template
<div class="blah">
$var
<div class="thing">
<span class="stuff">$var2</span>
</div>
$var3
</div>