Abstract classes are special because they can never be instantiated. Instead, you typically inherit a set of base functionality from them in a new class. For that reason, they are commonly used as the base classes in a larger class hierarchy.
/**
* Created by PhpStorm.
* User: Manikanta
* Date: 10/20/2015
* Time: 6:48 PM
*/
abstract class User extends CI_Controller{
public $name;
public $mobile;
public $email;
function show(){
echo $this->name;
}
}
class Vendor extends User{
function __construct(){
parent::__construct();
}
function index(){
$this->name="Mani";
parent::show();
}
}
0 comments:
Post a Comment