Working in Joomla, I have my model and view set up, but when the page is loaded, no data appears.
Model:
class mlsModelmls extends JModel
{
/**
* Gets the info
*/
function mlsdata($column)
{
$db =& JFactory::getDBO();
$query = "
SELECT *
FROM ".$db->nameQuote('#__mls')."
WHERE ".$db->nameQuote('MSTMLSNO')." = ".$db->quote('4112065').";
";
$db->setQuery($query);
$row = $db->loadRow();
print_r($row[$column]);
}
}
View:
class mlsViewmls extends JView
{
function mlsnum($tpl = null)
{
$model = &$this->getModel();
$mlsnum = $model->mlsdata(MSTMLSNO);
$this->assignRef( 'mlsnum', $mlsnum );
$agentuid = $model->mlsdata(MSTLISTBRD);
$this->assignRef( 'agentuid', $agentuid );
$listdt = $model->mlsdata(MSTLISTDT);
$this->assignRef( 'listdt', $listdt );
/** Some more assignRef() */
parent::display($tpl);
}
}
TMPL:
<h2 class="price">
<?php echo $this->mlsnum; ?>
</h2>
When the page is loaded, the TMPL looks fine, but no data appears for the <?php echo $this->mlsnum; ?>
reference call.
Does each assignRef()
need it's own function?