Hello!
I’ve just created a Widget named ExchangeRate. So I have ExchangeRate.php inside protected/components/
Here is the code for the class:
class ExchangeRate extends CWidget
{
public function run()
{
$this->render('renderExRate');
}
}
renderExRate.php is located inside protected/components/views and has the following code:
<?php echo date("m.d.y"); ?>
<table border="1">
<tr>
<td colspan ="3">Cash Exchange Rate</td>
</tr>
<tr>
<td></td>
<td>Rate 1</td>
<td>Rate 2</td>
</tr>
<tr>
<td>THB</td>
<td>Actual Value 1</td>
<td>Actual Value 2</td>
</tr>
</table>
Now I’m using CPorlet together with ExchangeRate widget like this:
<div id="sidebar">
<?php
$this->beginWidget('zii.widgets.CPortlet', array(
'title'=>'Exchange Rate',
));
$this->widget('ExchangeRate');
$this->endWidget();
?>
</div><!-- sidebar -->
The code above is located inside column2.php
So the result like this:
3570
The table doesn’t have border event I’ve set
<table border="1">
What did this happen?
Thank you for reading!
Kind regards.