This is my class code:
class myClass
{
public function myFunc()
{
$myvar = \'Test str\';
}
public function result()
{
echo myClas
include "views.php";
class Controller extends views{
function index(){
$this->head();
$this->home();
}
function privacy(){
$this->head();
$this->privc();
}
function about(){
$this->head();
$this->abt();
}
function address(){
$this->head();
$this->add();
}
}
$obj=new Controller();
if(isset($_GET['fun'])){
$obj->$_GET['fun']();
}
else{
$obj->index();
}
This is views.php code
class views{
function head(){
include "views/header.php";
echo "
this is header";
}
function abt(){
include "views/about.php";
echo "
This is about us page";
}
function home(){
include "views/home.php";
echo "
This is Home page";
}
function privc(){
include "views/privacy.php";
echo "
This is privacy page";
}
function add(){
include "views/address.php";
echo "
This is address page";
}
}