Basically, I've got a variable in com_mycomponent/views/mycomponent/tmpl/default.php
Which looks like this:
Code: Select all
$file = $fileRS->fields['filename']->value;
It returns the filename of a document from an Indexing Server Catalog object. And it works.
I want to pass $file back to a function in com_mycomponent/models/mycomponent.php
here's my function:
Code: Select all
function getDOCmanDocName($file)
{
$db =& JFactory::getDBO();
$query = 'SELECT dmname AS text'
. ' FROM #__docman'
. ' WHERE dmfilename = ' . $file;
$db->setQuery( $query );
$docname = $db->loadResult();
return $docname;
}
Code: Select all
$model =& $this->getModel();
$docname = $model->getDOCmanDocName();
$this->assignRef('docname', $docname);
Would appreciate thoughts anyone.. thanks
chris