Ciao ragazzi, espongo il problema:
- ho una view 'SocialMarketViewProfile' alla quale devo attaccare il model 'SocialMarketModelSocialMarket'
- nel controller:
codice:
function __construct()
{
parent::__construct();
switch(JRequest::getString('view'))
{
case 'profile':
$view =& $this->getView('Profile','html','SocialMarketView');
$model =& $this->getModel('socialmarket');
$view->setModel($model,true);
$view->display();
break;
.....
}
}
- Nella view:
codice:
function display($tpl = null)
{
$profile = $this->get('ProfileByIdp');
$this->assignRef('profile', $profile);
parent::display($tpl);
}
- nel default.php tpl è tutto ok se uso l'array profile ma tutto l'html che esiste già me lo riscrive 2 volte.
Es.:
codice:
$profile = $this->profile;
echo $profile->main_name;
echo " prova";
(prova me lo stampa 2 volte)
qualcuno mi sa illuminare?
Grazie!