Category ID always return 0 in item/view.html.php
Posted: 04 Mar 2021, 10:54
Hi... i'd like to ask why I always get 0 for category_id. this is teh particular code that always retun zero.
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->u = JFactory::getUser();
$uri = JFactory::getURI();
$model = $this->getModel();
$document = JFactory::getDocument();
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0, 'int'); //This particular line always return 0
$this->category = $model->getCategory($id, $catid);
$this->item = $model->getItem($id, $catid);
if it's zero, in the next script it will be changed into item_id and create errors. I inspect the element and found hidden input with the name of catid but the values is 1. So, why I get 0 in the script?
I use phoca 3.0.0 and joomla 3.7.0
$app = JFactory::getApplication();
$this->p = $app->getParams();
$this->u = JFactory::getUser();
$uri = JFactory::getURI();
$model = $this->getModel();
$document = JFactory::getDocument();
$id = $app->input->get('id', 0, 'int');
$catid = $app->input->get('catid', 0, 'int'); //This particular line always return 0
$this->category = $model->getCategory($id, $catid);
$this->item = $model->getItem($id, $catid);
if it's zero, in the next script it will be changed into item_id and create errors. I inspect the element and found hidden input with the name of catid but the values is 1. So, why I get 0 in the script?
I use phoca 3.0.0 and joomla 3.7.0