We're getting the question pretty often.. "Are you maintaining Free and Pro development environments?" The answer is very short... No! Below we will show you how we maintain all components (Pro or Free) within one development environment. We have specific tags inside our code which is not visible for you as customer as you have downloaded built code.
During the release build, the component builder is removing code for free and pro (depends on your build) versions. Below we will give you an example of a part of the script.
defined('_JEXEC') or die;
/* >>> [FREE] >>> */
// This is only available in the Pro version.
/* <<< [FREE] <<< */
/* >>> [PRO] >>> */
class RDSubsViewCoupons extends JViewLegacy
function display($tpl = null)
$this->pagination = $this->get('Pagination');
$this->items = $this->get('List');
/* <<< [PRO] <<< */
OK, looks good! But what does this script? All parts between
/* >>> [FREE] >>> */ and
/* <<< [FREE] <<< */ will be removed automatically when building a PRO version of your extension. Also the Pro tags will be removed as you don't want to show them to your customers. This way only the PRO code will be kept in the script. In the example above it is removing a complete view, but you can use this anywhere in the script.
When you create a Free version of your extension, then the builder is removing the Pro parts (everything between
/* >>> [PRO] >>> */ and
/* <<< [PRO] <<< */ in the script. This way you're able to maintain Free and Pro versions from one development environment.
** Special Thanks to Peter van Westen from Regular Labs for helping me out with this awesome piece of code! **