All posts by Pramod T P

WordPress Plugin Categories – PHPCodezCategories

It lists categories

== Description ==

PHPCodez Categories lists the categories. The output can be managed from  the back end

Advatages
======
1) We can restrict the number of categories
2) We can list the post count along with the category name .
3) We can sort the categories based on name, number of posts or id in
ascending/descending oreder
4) We can list only root categories .
Note : It will display only root categories and its first level sub categories
5) We can exclude categories if needed

== Installation ==

1. Upload the plugin folder to your /wp-content/plugins/ folder.

2. Go to the **Plugins** page and activate the plugin.

3. Go to appearance->widget area and drag the widget “PHPCodez Categories” to the wiget area to have this on the sidebar .

Click here to download

Encapsulation

Encapsulation is the packing of data and functions into a single component. The features of encapsulation are supported using classes in most object-oriented programming languages, although other alternatives also exist.

Abstract Classes

PHP 5 introduces abstract classes and methods. Classes defined as abstract may not be instantiated, and any class that contains at least one abstract method must also be abstract. Methods defined as abstract simply declare the method’s signature – they cannot define the implementation.

When inheriting from an abstract class, all methods marked abstract in the parent’s class declaration must be defined by the child; additionally, these methods must be defined with the same (or a less restricted) visibility. For example, if the abstract method is defined as protected, the function implementation must be defined as either protected or public, but not private. Furthermore the signatures of the methods must match, i.e. the type hints and the number of required arguments must be the same. For example, if the child class defines an optional argument, where the abstract method’s signature does not, there is no conflict in the signature.

Constructor

A is special method of the class that will be automatically invoked when an instance of the class is created is called as constructor.

Constructors are mainly used to initialize private fields of the class while creating an instance for the class.

When you are not creating a constructor in the class, then compiler will automatically create a default constructor in the class that initializes all numeric fields in the class to zero and all string and object fields to null.

Types of Constructors

  • Default Constructor
  • Parameterized Constructor
  • Copy Constructor
  • Static Constructor
  • Private Constructor