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

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

javascript - addthis share facebook and google+ url -

ios - Show keyboard with UITextField in the input accessory view -