Top 11 new features of ES6


ES6 (ECMA Script 6) or ECMA 2015 is the latest version of JavaScript released in June, 2015. ES6 is having lots of cool new features which we are going to explore in the upcoming sessions. Lot of popular JavaScript frameworks such as Angular 2 and React JS are started using the ES 6 features. Currently

PHP style date formats for JavaScript


Developers who worked in PHP know the features of Date functions and formats. The following code will give an idea to implement a PHP style date formats in JavaScript. This class is not a complete solution, it has just only day formats, please extend it to month and year.

How to use this?

JavaScript Method Chaining


Method chaining pattern is very useful to call multiple methods on a same object. This design pattern is very popular in most of the Object Oriented Programming languages such as Ruby, Java, PHP and JavaScript. Nowadays most of the frameworks/CMSs uses Method chaining pattern including jQuery (JavaScript), YII (PHP) and Drupal (PHP) etc. Let’s have

Change post title on the fly


There are situations, where we want to alter the WordPress post title before saving it. Here is the code to append the current user’s name to the post title.

 

PHP Inheritance


Inheritance allows child classes to use its parent class members. This is very useful when you want to have common functionalities for most of the child classes in the base class. Inheritance in PHP:

  We are going to create a base class called “greetings” which will have a “check_date()” method to check the

PHP Constructor and Destructor


Both constructor and destructor are PHP’s magic methods. Constructor: The constructor function will be automatically called when we instantiate an object when it is being initialized. PHP’s constructor should be defined as: In PHP 5 and above:

    In PHP 4:

Here “yourclassname” must be your actual class name where you have

PHP Abstract Class


PHP’s abstract class is a base class which will have abstract methods with no definition. Abstract classes cannot be instantiated or in other words, you cannot create an object of an abstract class. An abstract class can have non abstract methods also. Class which has at least one abstract method should always declare as an

PHP Multiple Inheritance using Traits


The problem of multiple inheritances in PHP will occur when two classes are having same method. This can be avoided using “traits”. This feature is available from PHP version 5.4.0 Simple Multiple Inheritance using Traits:

 

Sponsored

Follow me

Popular posts