php - Insert class if true -
how insert class php if true? here's best guess far:
<divclass="<?php if($this->step==2){ somehow set name of class } ?>
you're close; can echo class php.
<!-- either try this... --> <div class="<?php if($this->step === 2) { echo 'twostep'; } ?>"></div> <!-- ...or --> <div class="<?=$this->step === 2 ? 'twostep' : 'notwostep'?>"></div>
Comments
Post a Comment