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

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

java - SmsManager sending message more than one -