Hi Friends ,

I m new to Joomla and I developed a admin part component and after successfull data insert I need to do a redirect to my component view.

My doubt is how to do this redirection from my "Model"

I got a code Like this

$msg = 'A MESSAGE';
$link = 'index.php?option=com_gallery';
$this->setRedirect( JRoute::_($link, false), $msg,'error' );

But this giving the following error

Fatal error: Call to undefined method GalleryModelitem::setRedirect() in C:\wamp\www\joomla\administrator\components\com_gallery\models\item.php on line 126

Please help

Thanks in advance

'setRedirect' is the method of joomla core controller. You need to import the core library and extends your class to the 'JController'. I'm not sure is there another way to solve the problem. You can find the problem on joomla forum and support.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.