mysql - Php and Controller: Browser don't find Base Controller -


i'm doing app , i'm using base controller create others ones. when launch controller see error:

fatal error: class 'basecontroller' not found in c:\xampp\htdocs\sfitness\api\1-dev\controllers\peoplecontroller.php on line 3 

the problem in same folder i've basecontroller.php

following send peoplecontroller.php:

<?php  class peoplecontroller extends basecontroller {      public function processgetrequest($request) {         $result = null;         $result = $this->_model->getallathletes();            return $result;      } }  ?> 

following basecontroller.php

<?php  abstract class basecontroller {      public $_model;      public function __construct() {         $this->_model = new model();     }  } ?> 

how can resolve problem? what's problem?

thanks much

you should import other file php can see it; in peoplecontroller, following:

 <?php require_once "basecontroller.php";  class peoplecontroller extends basecontroller  {      public function processgetrequest($request)      {          $result = null;          $result = $this->_model->getallathletes();             return $result;      } }  ?> 

Comments

Popular posts from this blog

html - Difficulties with background-image property -

visual studio code - What does the isShellCommand property actually do and how should you use it? -

ios - Segue not passing data between ViewControllers -