MVC - Passing data between Controller and View via Model - Joomla! Forum - community, help and support
hi there, im new joomla hav understanding of php. basically need make component joomla , after reading mvc tutorials did successfully :d woow! however current problem: when access method in controller need set variable values , pass these view can assign them variables in layout. in tutorials says controller used call methods in model update data model is passed view , problem if access variable model in view model has been re initiated , changes made controller lost. let me show code in controller: code: select all $model =& $this->getmodel(); $model->setmydata(); parent::display(); in model: code: select all var $test= 'default'; function __construct() { parent::__construct(); } function getmydata() { return $this->test; } function setmydata() { $this->test = 'hello model'; } in view: code: select all $word = $this->get('mydata'); $this->assignref('greeting', $word); note: ive tried accessing model using same code cont...