Hello All Actually I'm learning joomla component designing and also Writing my own component in which i want to add a custom function. but i have two confusion
- I saw there is a publish function in joomla that can be found in Admin Controller This functions do some checking on id's and call the same function in model and in model this function calls for same function in table class. why they do so as we can get the Db object in controller using JFactory::getDbo() and can insert, update data in table using it. then why the go so long
- Second this is the below code
$data = array('publish' => 1, 'unpublish' => 0, 'archive' => 2, 'trash' => -2, 'report' => -3); $task = $this->getTask(); $value = JArrayHelper::getValue($data, $task, 0, 'int');
this code can be found in publish function of controller but I'm still confused about the above line of code why the do it.?
Please Help Me