Thursday, April 15, 2010

Super keyword in haXe

Using the super keyword, we can use the methods of parent class in a derived class while that method is being overridden in derived class. See the following example:
class child extends parent {
function care() : Int {
return super.care() + 1;
}
}
Here we override care() method of parent, but still we use the parent class method in it using super keyword. We can also call the constructor of parent class in our class using super:
class child extends parent {
function new(){
super();
}
}
Note that we do not use the constructor function name of parent class here, only used super(). It brings the properties of parent class to the derived class.
See the book OpenCart 1.4 Template Design Cookbook.
See the book Joomla Mobile Development Beginners Guide




List of my works:

Opencart Extensions:

  1. Product Based Quantity Wise Shipping: Find it here.
  2. OpenSSLCOMMERZ: integrate SSLCOMMERZ with opencart: Find it here.
  3. Fine Search v.1.0 - Improves Opencart search feature to find relevant: Find it here.
  4. Opensweetcaptcha - An easy way to generate attractive captcha for your system!: Find it here.
  5. Custom Field Product - add unlimited custom fields to the product form: Find it here.
  6. Formcaptcha - add captcha on the register page: Find it here.

My Books:

  1. OpenCart 1.4 Template Design Cookbook.
  2. Joomla Mobile Development Beginners Guide

No comments: