How do I insert a class with php if something is true? Here's my best guess so far:
<div class="<?php
if($this->step==2){
somehow set the name of the class
} ?>">
You're close; what you can do is echo the class with PHP.
<!-- Either try this... -->
<div class="<?php if($this->step === 2) { echo 'twostep'; } ?>"></div>
<!-- ...or this -->
<div class="<?=$this->step === 2 ? 'twostep' : 'notwostep'?>"></div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With