I want to populate a div with with other divs inside, the inside divs will need to be created dynamically though. Would anyone be so kind as to show me a quick code example? Either that or suggest another way of rendering the data. What I’m trying to do is, display all user names logged into a particular room. At the moment I’m just printing their names in plain text in a <p> with <b/> after each name. I’d need to be able to color certain divs depending on certain conditions. Make sense?
class MyXXX extends CWidget{
public $someVar;
public function run(){
$this->render('xxx');
}
}
// in your views/xxx.php
<?php if($someVar == $xx): ?>
some div output
<?php endif; ?>
<?php if($someVar == $yy): ?>
some div output
<?php endif; ?>