1

I'm developing a view that need to reuse a model, I'm following this documentation http://docs.joomla.org/Using_multiple_models_in_an_MVC_component. But that reference do the trick just (at least as far as I understand) when I use the parameter get task. if I use the view, joomla get me null data.

more clearly

controller.php - the task I named as the view I need

function viewdowhatIneed(){
    $view = & $this->getView('viewdowhatIneed',html);
    $view->setModel( $this->getModel( 'thenotdefaultmodelthatIneed' ), true );
    $view->display();
}

model - thenotdefaultmodelthatIneed.php

class BLAModelthenotdefaultmodelthatIneed extends Jmodel{
    function getReusableData0(){...}
    function getReusableData1(){...}
}

view - view.html.php

class BLAViewviewdowhatIneed extends JView{
    function display($tpl=null){
        $dataneedit0 = $this->get('ReusableData0');
        $dataneedit1 = $this->get('ReusableData1');
        $this->assignRef('dataneedit0',$dataneedit0);
        $this->assignRef('dataneedit1',$dataneedit1);
        parent::display($tpl);
    }
}

SO, what happen to me is:

example.com/index.php?option=com_BLA&view=viewdowhatIneed -> variables(datadataneedit0,dataneedit1) == NULL

example.com/index.php?option=com_BLA&task=viewdowhatIneed -> variables(datadataneedit0,dataneedit1) == Get me right data

then, my question is, is there a way to do the same thing, by using view parameter without task parameter (btw, I know this could be not a important problem, but I'm not an expert and on this reference http://docs.joomla.org/How_Joomla_pieces_work_together, it says:

The task part may or may not exist. Remember that if you omit it you are defaulting to task=display

so I really want to know that. In other words, can my view force to check the controller or vice versa.

Thanks in advance, excuse my english

raulricardo21
  • 2,499
  • 4
  • 20
  • 27
  • I really apreciate some help.. – raulricardo21 Aug 23 '11 at 05:52
  • oh no, I'm not pretending to do something to extraordinary, and I'm well aware that I'm not and expert, but my question is nothing but some that came up from that very simple documentation. I'm just asking if it is alwawys in that or not. Now about that metric, thanks I will have that in mind. – raulricardo21 Aug 23 '11 at 13:38

0 Answers0