Skip to content

Instantly share code, notes, and snippets.

@k2052
Created September 18, 2012 17:11
Show Gist options
  • Save k2052/3744370 to your computer and use it in GitHub Desktop.
Save k2052/3744370 to your computer and use it in GitHub Desktop.
Quick Joomla 3.0 Compatibility

So you want to add Joomla! 3.0 compatibility to your component? The old MVC is still available but unfortunately, the names of the classes have changed.

Just add the following somewhere, then rename all your classes to extend the legacy classes. After that all you have to do is make sure you're not using any depreciated methods. Of course, eventually you should work on full compatibility you lazy developer!

<?php 

jimport('joomla.application.component.controller');
jimport('joomla.application.component.view');
jimport('joomla.application.component.model');

if(!class_exists('JControllerLegacy'))
{
  class JControllerLegacy extends JController {}
  class JViewLegacy extends JView {}
  class JModelLegacy extends JModel {}
}

defined('DS') ? null : define('DS',DIRECTORY_SEPARATOR);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment