JRequest::getCmd
如果弃用,我在文档中找不到如何在 joomla 2.5 中修改它 !
function propios(){
$model = &$this->getModel(JRequest::getCmd('view'));
$view = &$this->getView(JRequest::getCmd('view'), 'html');
$view->setModel($model, true);
$view->hardwarePropio();
}
任何的想法!
最后我的控制是
class HardwareController extends JController
{
// busca los hardwares propios
function propios(){
$jinput = JFactory::getApplication()->input;
$view = $jinput->getCmd('view', 'hardwares');
JFactory::getApplication()->input->set('view', $view);
$model = &$this->getModel($view);
$view = &$this->getView($view, 'html');
$view->setModel($model, true);
$view->$view->hardwarePropio();
}
$view = JFactory::getApplication()->input->getCmd('view', 'hardwares');
JFactory::getApplication()->input->set('view', $view);
如果我删除最后两行,则视图中调用函数的链接不起作用
<a href="<?php echo JURI::root()?>index.php/hardware/propios">Equipos propios</a>
如何调用function hardwarePropio()