Jrequest: :getCmd Deprecate

Jrequest: :getCmd Deprecate

I dont find in the documentation How to modified this in joomla 2.5 if JRequest::getCmd deprecate!!

function propios(){
    $model = &$this->getModel(JRequest::getCmd('view'));
    $view  = &$this->getView(JRequest::getCmd('view'), 'html');
    $view->setModel($model, true);
    $view->hardwarePropio();
}

any idea!

finally my control is

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);

If I erase the last two line, the link in the view to call a function dont work

<a href="<?php echo JURI::root()?>">Equipos propios</a>

How to call the function hardwarePropio()

1 Answer

Instead of this-

$model = &$this->getModel(JRequest::getCmd('view'));
$view  = &$this->getView(JRequest::getCmd('view'), 'html');
$view->setModel($model, true);
$view->hardwarePropio();

You can use this-

$jinput   = JFactory::getApplication()->input;
$view     = $jinput->getCmd('view', 'hardwares');

$model = &$this->getModel($view);
$view  = &$this->getView($view,'html');
$view->setModel($model, true);
$view->hardwarePropio();

API -

5

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Maya Lin-Takahashi
Author

Maya Lin-Takahashi

Maya is a hardware enthusiast who tests and reviews smart home devices, smartphones, wearables, and audio gear. She focuses on practical consumer value and build quality.