How to change / set the Joomla template programmatically from within a Joomla 1.5+ component

Yup, this might be an interesting feature, but how easy or hard is to implement?

It's simpler, than you might imagine!

Create a function somewhere in your component:

function templatechanger($templatename) {
global $mainframe;
$mainframe->setTemplate = $templatename;

Then where you want to call it, initialize the variable, for example like:


and call the function:


Simple enough?

Benefit from fantastic savings on Free Hosting ( , just by taking a look at bigonlinedeal