Welcome Guest, Not a member yet? Register   Sign In
how to extend a class in controller
#1

[eluser]siubie[/eluser]
hi guys iam trying to extend a class in controller :
Code:
<?php

class ControlPanel extends Controller {
  var $Title;
  var $Heading;

    function ControlPanel(){
    parent::Controller();
        session_start();
        $this->load->model('web_model');
        $this->Title="Title";
        $this->Heading="Heading";
    }

    function index(){
          $data['Title']=$this->Title;
          $data['Heading']=$this->Heading;
          $data['CuapCuap']="Welcome" . $this->Heading;
          $this->load->model('web_model');
      $this->load->view('default',$data);
    }

  }

?>
then i try to extend ControlPanel class to ControlPanelExtend
Code:
<?php

class ControlPanelExtend extends ControlPanel {
  var $Title;
  var $Heading;

    function ControlPanelExtend(){
    parent::Controller();
        session_start();
        $this->load->model('web_model');
        $this->Title="Title";
        $this->Heading="Heading";
    }

    function index(){
          $data['Title']=$this->Title;
          $data['Heading']=$this->Heading;
          $data['CuapCuap']="Welcome" . $this->Heading;
          $this->load->model('web_model');
      $this->load->view('default',$data);
    }
        function logout(){
          session_destroy();
          redirect('controlPanel','refresh');
        }

  }

?>

i got error code:
Fatal error: Class 'ControlPanel' not found in F:\xampp\htdocs\code\system\application\controllers\ControlPanelAdmin.php on line 3

is iam doing wrong about this ?


Messages In This Thread
how to extend a class in controller - by El Forum - 02-24-2009, 11:30 PM
how to extend a class in controller - by El Forum - 02-25-2009, 04:46 AM
how to extend a class in controller - by El Forum - 02-25-2009, 04:57 AM
how to extend a class in controller - by El Forum - 02-26-2009, 11:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB