class MyModel extends JModelLegacy { public function __construct($config = array()) { parent::__construct($config); // Add custom code here } }
$model = new JModelLegacy();In this example, a new object of the JModelLegacy class is created without any custom configuration options. The JModelLegacy __construct method is called automatically to initialize the object. Package library: Joomla Framework.