Php 严格的标准错误,无法解决

Php 严格的标准错误,无法解决,php,Php,我试过了,但没能解决,检查过了,在严格的标准上得到了错误 严格的标准:只有变量应该通过引用传递 我做错了什么-如何纠正 $this->assignRef('prodDet' , $prodDet); $this->assignRef('CatName' , $modelNewcar->getCatName($id)); $this->assignRef('nav' , $nav); $this->assignRef('CatList' , $modelNe

我试过了,但没能解决,检查过了,在严格的标准上得到了错误

严格的标准:只有变量应该通过引用传递

我做错了什么-如何纠正

$this->assignRef('prodDet'  , $prodDet);
$this->assignRef('CatName'  , $modelNewcar->getCatName($id));

$this->assignRef('nav'  , $nav);
$this->assignRef('CatList'  , $modelNewcar->loadMainCat($brand,$Carmodel,$minprice,$maxprice,$fuel_type));
    $this->assignRef('CatName'  , $modelNewcar->getCatName);
parent::display($tpl);
下面是原始代码

function display($tpl = null)
{
    $mainframe =JFactory::getApplication();
    $option = JRequest::getCmd('option');

    $db         =JFactory::getDBO();
    $user               = JFactory::getUser();
    // Push a model into the view
    $model              = $this->getModel();
    $modelNewcar    = $this->getModel( 'product' );
    $id = JRequest::getVar('id','','default','int');
    $vid = JRequest::getVar('vid','','default','int');

    $prodDet = $modelNewcar->loadProduct($id,$vid);

    $this->assignRef('prodDet'  , $prodDet);
    $this->assignRef('CatName'  , $modelNewcar->getCatName($id));

    parent::display($tpl);
}

 function display($tpl = null)
{
    $db =JFactory::getDBO();
    $user               = JFactory::getUser();
    // Push a model into the view
    $model              =$this->getModel();
    $modelNewcar    =$this->getModel( 'category' );

    $brand = JRequest::getVar('brand','','default','int');
    $Carmodel = JRequest::getVar('model','','default','int');
    $minprice = JRequest::getVar('minprice','','default','int');
    $maxprice = JRequest::getVar('maxprice','','default','int');
    $fuel_type = JRequest::getVar('fuel_type','','default','');


        $this->assignRef('nav'  , $nav);
    $this->assignRef('CatList'  , $modelNewcar->loadMainCat($brand,$Carmodel,$minprice,$maxprice,$fuel_type));
        $this->assignRef('CatName'  , $modelNewcar->getCatName);
    parent::display($tpl);
}

这正是错误所说的
$this->assignRef()
通过引用分配变量

例如:

$this->assignRef('CatName'  , $modelNewcar->getCatName($id));
在这里,您尝试将函数
getCatName()
传递到
assignRef()
。解决方案是首先将其分配给一个变量

$catName = $modelNewcar->getCatName($id);
$this->assignRef('CatName'  , $catName);

文档:

这正是错误所说的
$this->assignRef()
通过引用分配变量

例如:

$this->assignRef('CatName'  , $modelNewcar->getCatName($id));
在这里,您尝试将函数
getCatName()
传递到
assignRef()
。解决方案是首先将其分配给一个变量

$catName = $modelNewcar->getCatName($id);
$this->assignRef('CatName'  , $catName);
文件: