2

I believe JRequest is depreciated and should be replaced with Jinput, however when I change the following code:

$limit = JRequest::getInt('limit', $app->get('list_limit'));
$this->setState('list.limit', $limit);         
$limitstart = JRequest::getInt('limitstart', 'limitstart', 0);

to this:

$jinput = JFactory::getApplication()->input;
$limit = jinput::getInt('limit', $app->get('list_limit'));
$this->setState('list.limit', $limit);         
$limitstart = jinput::getInt('limitstart', 'limitstart', 0);

It doesn't work.

Does anyone know what I'm doing wrong?

3

Reason why you're code isn't working is because you haven't called the $jinput variable correctly. Also, getInt is not a static function, therefore should not be called statically.

So replace this:

$jinput = JFactory::getApplication()->input;
$limit = jinput::getInt('limit', $app->get('list_limit'));
$this->setState('list.limit', $limit);         
$limitstart = jinput::getInt('limitstart', 'limitstart', 0);

with this:

$jinput = JFactory::getApplication()->input;
$limit = $jinput->getInt('limit', $app->get('list_limit'));
$this->setState('list.limit', $limit);         
$limitstart = $jinput->getInt('limitstart', 'limitstart', 0);

I'm surprised you didn't get any errors when viewing the site. So in future, please set Error Reporting on your Global Configuration to Development

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.